From 2f5319e7507d1ac5733a7d0a5b9021465c7eda19 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sat, 28 Jun 2008 13:44:10 +0000 Subject: Bugfix: Empty integer key parsing. svn-id: r32822 --- common/xmlparser.h | 14 +++++++------- 1 file 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. */ -- cgit v1.2.3