Skip to content

Commit

Permalink
Merge pull request #585 from lioncash/sprintfs
Browse files Browse the repository at this point in the history
DolphinWX: Kill off sprintf calls in CheatsWindow.cpp
  • Loading branch information
delroth committed Jul 9, 2014
2 parents beeed52 + 54105a8 commit 29873a7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/Core/DolphinWX/CheatsWindow.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 29873a7

Please sign in to comment.