diff options
| author | Lioncash <mathew1800@gmail.com> | 2014-07-08 16:19:34 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-07-08 16:19:34 -0400 |
| commit | 54105a8bbae5c0dc82a5b3873d0ec8d08bec899a (patch) | |
| tree | 9e981890cec0f46b1331656453491596fc03c6b9 /Source | |
| parent | 3bde3988ebb3663ce26794c61cea2c92e7b49eb5 (diff) | |
DolphinWX: Kill off sprintf calls in CheatsWindow.cpp
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/CheatsWindow.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/CheatsWindow.cpp b/Source/Core/DolphinWX/CheatsWindow.cpp index 60c0d18c1d..13d8dfd4ce 100644 --- a/Source/Core/DolphinWX/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/CheatsWindow.cpp @@ -32,6 +32,7 @@ #include "Common/Common.h" #include "Common/IniFile.h" +#include "Common/StringUtil.h" #include "Core/ActionReplay.h" #include "Core/ConfigManager.h" #include "Core/Core.h" @@ -332,17 +333,14 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (e { ARCode code = GetARCode(i); m_Label_Codename->SetLabel(_("Name: ") + StrToWxStr(code.name)); - char text[CHAR_MAX]; - char* numcodes = text; - sprintf(numcodes, "Number of Codes: %lu", (unsigned long)code.ops.size()); + + std::string numcodes = StringFromFormat("Number of Codes: %lu", (unsigned long)code.ops.size()); m_Label_NumCodes->SetLabel(StrToWxStr(numcodes)); m_ListBox_CodesList->Clear(); for (const AREntry& entry : code.ops) { - char text2[CHAR_MAX]; - char* ops = text2; - sprintf(ops, "%08x %08x", entry.cmd_addr, entry.value); + std::string ops = StringFromFormat("%08x %08x", entry.cmd_addr, entry.value); m_ListBox_CodesList->Append(StrToWxStr(ops)); } } |
