]> git.sur5r.net Git - cc65/commitdiff
Fix strtoul 'endptr' return value: It should point to the first invalid character,
authorChristian Groessler <chris@groessler.org>
Wed, 11 Sep 2013 19:53:13 +0000 (21:53 +0200)
committerChristian Groessler <chris@groessler.org>
Wed, 11 Sep 2013 19:53:13 +0000 (21:53 +0200)
not to the last valid character.

libsrc/common/strtoul.c

index fa0d64f42f5636ba7ab95dbbbad0cd3d083c7ed4..54466db3601463bf6d90acf82f21eeee07f5f843 100644 (file)
@@ -97,7 +97,7 @@ unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base)
      */
     if (endptr) {
         if (CvtCount > 0) {
-            *endptr = (char*) S - 1;
+            *endptr = (char*) S;
         } else {
             *endptr = (char*) nptr;
         }