mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
Fixed endp bug in strtoul()
This commit is contained in:
@@ -164,7 +164,7 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ( 1 ) {
|
while ( 1 ) {
|
||||||
charval = *(p++) - '0';
|
charval = ( *p - '0' );
|
||||||
if ( charval > ( 'A' - '0' - 10 ) )
|
if ( charval > ( 'A' - '0' - 10 ) )
|
||||||
charval -= ( 'A' - '0' - 10 );
|
charval -= ( 'A' - '0' - 10 );
|
||||||
if ( charval > ( 'a' - 'A' ) )
|
if ( charval > ( 'a' - 'A' ) )
|
||||||
@@ -172,6 +172,7 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
|
|||||||
if ( charval >= ( unsigned int ) base )
|
if ( charval >= ( unsigned int ) base )
|
||||||
break;
|
break;
|
||||||
ret = ( ( ret * base ) + charval );
|
ret = ( ( ret * base ) + charval );
|
||||||
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( endp )
|
if ( endp )
|
||||||
|
|||||||
Reference in New Issue
Block a user