From ebfb4a0b528288e15ba4bedaead53d10cf75e8e5 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Wed, 11 Sep 2013 21:53:13 +0200 Subject: [PATCH] Fix strtoul 'endptr' return value: It should point to the first invalid character, not to the last valid character. --- libsrc/common/strtoul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5