diff options
author | Vicent Marti | 2008-06-28 13:44:10 +0000 |
---|---|---|
committer | Vicent Marti | 2008-06-28 13:44:10 +0000 |
commit | 2f5319e7507d1ac5733a7d0a5b9021465c7eda19 (patch) | |
tree | 03bddc1d2f070cc68c02eb4cb6a5ceb0d8e6a8c1 | |
parent | 3f0f7fa08bea272fa61b0fde5d7783aa44b1ff25 (diff) | |
download | scummvm-rg350-2f5319e7507d1ac5733a7d0a5b9021465c7eda19.tar.gz scummvm-rg350-2f5319e7507d1ac5733a7d0a5b9021465c7eda19.tar.bz2 scummvm-rg350-2f5319e7507d1ac5733a7d0a5b9021465c7eda19.zip |
Bugfix: Empty integer key parsing.
svn-id: r32822
-rw-r--r-- | common/xmlparser.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/xmlparser.h b/common/xmlparser.h index c3cdbc3e02..4850dc5113 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -306,7 +306,7 @@ protected: * @returns True if the parsing succeeded. */ virtual bool parseIntegerKey(const char *key, int count, ...) { - char *parseEnd = 0; + char *parseEnd; int *num_ptr; va_list args; @@ -319,17 +319,17 @@ protected: num_ptr = va_arg(args, int*); *num_ptr = strtol(key, &parseEnd, 10); - while (isspace(*parseEnd)) - parseEnd++; + key = parseEnd; - if (count && *parseEnd++ != ',') - return false; + while (isspace(*key)) + key++; - key = parseEnd; + if (count && *key++ != ',') + return false; } va_end(args); - return (*parseEnd == 0); + return (*key == 0); } int _pos; /** Current position on the XML buffer. */ |