diff --git a/Source/Core/Common/IniFile.h b/Source/Core/Common/IniFile.h index b2b3dba5f0..abfb58b0a6 100644 --- a/Source/Core/Common/IniFile.h +++ b/Source/Core/Common/IniFile.h @@ -56,7 +56,7 @@ public: void Set(const char* key, int newValue, int defaultValue); void Set(const char* key, int newValue) { - Set(key, std::to_string(newValue).c_str()); + Set(key, StringFromInt(newValue).c_str()); } void Set(const char* key, bool newValue, bool defaultValue); diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index a0a8c739ca..7ad4ac6ca5 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -185,6 +185,13 @@ bool TryParse(const std::string &str, bool *const output) return true; } +std::string StringFromInt(int value) +{ + char temp[16]; + sprintf(temp, "%i", value); + return temp; +} + std::string StringFromBool(bool value) { return value ? "True" : "False"; diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index ab3abc617d..7846cbee3d 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -55,6 +55,7 @@ std::string ThousandSeparate(I value, int spaces = 0) return oss.str(); } +std::string StringFromInt(int value); std::string StringFromBool(bool value); bool TryParse(const std::string &str, bool *output);