summaryrefslogtreecommitdiff
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-10-25 15:19:05 -0400
committerbunnei <bunneidev@gmail.com>2014-10-25 15:19:05 -0400
commit70058f8151a9c6599bbcd9d5772b87c9602ed0fa (patch)
treeb7f0711f1d817b18f041fea31cfcf0ebe9cbba69 /src/common/string_util.cpp
parent4615c73d15f6f27c5e275c57dcafcb56355b9c2d (diff)
parent7fa4dbd0c6e89aab762eaf29607a0a0ced660847 (diff)
Merge pull request #148 from archshift/no-cstring
Removed some uses of raw c-string manipulation functions.
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 9199e30bc..61f0939c4 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -186,9 +186,9 @@ bool TryParse(const std::string &str, u32 *const output)
bool TryParse(const std::string &str, bool *const output)
{
- if ("1" == str || !strcasecmp("true", str.c_str()))
+ if ("1" == str || "true" == ToLower(str))
*output = true;
- else if ("0" == str || !strcasecmp("false", str.c_str()))
+ else if ("0" == str || "false" == ToLower(str))
*output = false;
else
return false;
@@ -196,13 +196,6 @@ 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";