From: Michael Brown Date: Wed, 15 Nov 2006 02:54:28 +0000 (+0000) Subject: Fixed endp bug in strtoul() X-Git-Tag: v0.9.3~999 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbfb2e02fd5522df7acd537dc0b9e80f022f1f96;p=thirdparty%2Fipxe.git Fixed endp bug in strtoul() --- diff --git a/src/core/misc.c b/src/core/misc.c index 2765f7dcc..968e232d4 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -164,7 +164,7 @@ unsigned long strtoul ( const char *p, char **endp, int base ) { } while ( 1 ) { - charval = *(p++) - '0'; + charval = ( *p - '0' ); if ( charval > ( 'A' - '0' - 10 ) ) charval -= ( 'A' - '0' - 10 ); if ( charval > ( 'a' - 'A' ) ) @@ -172,6 +172,7 @@ unsigned long strtoul ( const char *p, char **endp, int base ) { if ( charval >= ( unsigned int ) base ) break; ret = ( ( ret * base ) + charval ); + p++; } if ( endp )