david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Fixed endp bug in strtoul()

This commit is contained in:
Michael Brown 2006-11-15 02:54:28 +00:00
parent 65ff5357f1
commit bbfb2e02fd
1 changed files with 2 additions and 1 deletions

View File

@ -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 )