From: Christian Groessler Date: Wed, 11 Sep 2013 19:53:13 +0000 (+0200) Subject: Fix strtoul 'endptr' return value: It should point to the first invalid character, X-Git-Tag: V2.15~223^2~38 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ebfb4a0b528288e15ba4bedaead53d10cf75e8e5;p=cc65 Fix strtoul 'endptr' return value: It should point to the first invalid character, not to the last valid character. --- diff --git a/libsrc/common/strtoul.c b/libsrc/common/strtoul.c index fa0d64f42..54466db36 100644 --- a/libsrc/common/strtoul.c +++ b/libsrc/common/strtoul.c @@ -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; }