summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/StringUtil.cpp
diff options
context:
space:
mode:
authorfires.gc <fires.gc@gmail.com>2008-07-17 21:46:34 +0000
committerfires.gc <fires.gc@gmail.com>2008-07-17 21:46:34 +0000
commit343d1ece115879ea2c8d77abbeadaa8ef3e3de77 (patch)
tree58513e74dd60b3076331e6c1f098d6a9a9dc219e /Source/Core/Common/Src/StringUtil.cpp
parent91ccda69efb56fa729c3f4f3209726238f656e29 (diff)
debugger improvments
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@25 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/StringUtil.cpp')
-rw-r--r--Source/Core/Common/Src/StringUtil.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp
index 4df2c4c05e..001f6f51ee 100644
--- a/Source/Core/Common/Src/StringUtil.cpp
+++ b/Source/Core/Common/Src/StringUtil.cpp
@@ -240,6 +240,13 @@ bool TryParseInt(const char* str, int* outVal)
{
const char* s = str;
int value = 0;
+ bool negativ = false;
+
+ if (*s == '-')
+ {
+ negativ = true;
+ s++;
+ }
while (*s)
{
@@ -252,6 +259,8 @@ bool TryParseInt(const char* str, int* outVal)
value = value * 10 + (c - '0');
}
+ if (negativ)
+ value = -value;
*outVal = value;
return(true);