Skip to content

Commit 5e12b9e

Browse files
Zegerieagleivg
authored andcommitted
Fix CUIMainIngameWnd xml section loading
From the standard: "If a call to sprintf or snprintf causes copying to take place between objects that overlap, the behavior is undefined."
1 parent e8134d7 commit 5e12b9e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/xrGame/ui/UIMainIngameWnd.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,10 @@ void CUIMainIngameWnd::Init()
235235
m_quick_slots_icons.push_back(new CUIStatic());
236236
m_quick_slots_icons.back()->SetAutoDelete(true);
237237
AttachChild(m_quick_slots_icons.back());
238-
string32 path;
239-
xr_sprintf(path, "quick_slot%d", i);
240-
CUIXmlInit::InitStatic(uiXml, path, 0, m_quick_slots_icons.back());
241-
xr_sprintf(path, "%s:counter", path);
242-
UIHelper::CreateStatic(uiXml, path, m_quick_slots_icons.back());
238+
std::string path = "quick_slot" + std::to_string(i);
239+
CUIXmlInit::InitStatic(uiXml, path.c_str(), 0, m_quick_slots_icons.back());
240+
path += ":counter";
241+
UIHelper::CreateStatic(uiXml, path.c_str(), m_quick_slots_icons.back());
243242
}
244243
m_QuickSlotText1 = UIHelper::CreateTextWnd(uiXml, "quick_slot0_text", this);
245244
m_QuickSlotText2 = UIHelper::CreateTextWnd(uiXml, "quick_slot1_text", this);

0 commit comments

Comments
 (0)