[Scummvm-cvs-logs] SF.net SVN: scummvm: [32822] scummvm/branches/gsoc2008-gui/common/xmlparser .h

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Sat Jun 28 15:44:10 CEST 2008


Revision: 32822
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32822&view=rev
Author:   Tanoku
Date:     2008-06-28 06:44:10 -0700 (Sat, 28 Jun 2008)

Log Message:
-----------
Bugfix: Empty integer key parsing.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/common/xmlparser.h

Modified: scummvm/branches/gsoc2008-gui/common/xmlparser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-06-28 13:40:03 UTC (rev 32821)
+++ scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-06-28 13:44:10 UTC (rev 32822)
@@ -306,7 +306,7 @@
 	 * @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 @@
 			num_ptr = va_arg(args, int*);
 			*num_ptr = strtol(key, &parseEnd, 10);
 
-			while (isspace(*parseEnd))
-				parseEnd++;
+			key = parseEnd;
 
-			if (count && *parseEnd++ != ',')
+			while (isspace(*key))
+				key++;
+
+			if (count && *key++ != ',')
 				return false;
-
-			key = parseEnd;
 		}
 
 		va_end(args);
-		return (*parseEnd == 0);
+		return (*key == 0);
 	}
 
 	int _pos; /** Current position on the XML buffer. */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list