Skip to content

Commit

Permalink
Fix CUIMainIngameWnd xml section loading
Browse files Browse the repository at this point in the history
From the standard: "If a call to sprintf or snprintf causes copying to
take place between objects that overlap, the behavior is undefined."
  • Loading branch information
Zegeri authored and eagleivg committed Nov 6, 2018
1 parent e8134d7 commit 5e12b9e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/xrGame/ui/UIMainIngameWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,10 @@ void CUIMainIngameWnd::Init()
m_quick_slots_icons.push_back(new CUIStatic());
m_quick_slots_icons.back()->SetAutoDelete(true);
AttachChild(m_quick_slots_icons.back());
string32 path;
xr_sprintf(path, "quick_slot%d", i);
CUIXmlInit::InitStatic(uiXml, path, 0, m_quick_slots_icons.back());
xr_sprintf(path, "%s:counter", path);
UIHelper::CreateStatic(uiXml, path, m_quick_slots_icons.back());
std::string path = "quick_slot" + std::to_string(i);
CUIXmlInit::InitStatic(uiXml, path.c_str(), 0, m_quick_slots_icons.back());
path += ":counter";
UIHelper::CreateStatic(uiXml, path.c_str(), m_quick_slots_icons.back());
}
m_QuickSlotText1 = UIHelper::CreateTextWnd(uiXml, "quick_slot0_text", this);
m_QuickSlotText2 = UIHelper::CreateTextWnd(uiXml, "quick_slot1_text", this);
Expand Down

0 comments on commit 5e12b9e

Please sign in to comment.