From 4964f49765f7963b9ee4b016fe5a3bc0581e1911 Mon Sep 17 00:00:00 2001 From: Kenneth Raplee <101818165+kenrap@users.noreply.github.com> Date: Sun, 27 Sep 2026 16:21:03 +0000 Subject: [PATCH] Fix size_t/%d format mismatch in MsgDialog::add_button (#15852) Fix size_t/%d mismatch in MsgDialog button keys `m_buttons.size()` is a `size_t`, which does not match the `%d` conversion in printf-style variadics. Build the key with `std::to_string` instead; exact for any size_t, no behavior change for realistic counts. Co-authored-by: yw4z --- src/slic3r/GUI/MsgDialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 0f1d3f62d5..8c981a970f 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -194,9 +194,10 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con bd->button = btn; //bd->type = type; - mb->id = wxString::Format("%d", m_buttons.size()); + // m_buttons.size() is a size_t, which does not match the %d conversion + mb->id = wxString(std::to_string(m_buttons.size())); mb->buttondata = bd; - m_buttons[ wxString::Format("%d", m_buttons.size())] = mb; + m_buttons[ wxString(std::to_string(m_buttons.size()))] = mb; return btn; };