david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

May as well add octal support to strtoul()

This commit is contained in:
Michael Brown 2006-11-15 02:57:24 +00:00
parent bbfb2e02fd
commit 5753f2c58b
1 changed files with 8 additions and 5 deletions

View File

@ -155,11 +155,14 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
unsigned int charval;
if ( base == 0 ) {
if ( ( p[0] == '0' ) && ( ( p[1] | 0x20 ) == 'x' ) ) {
base = 16;
p += 2;
} else {
base = 10;
base = 10;
if ( *p == '0' ) {
p++;
base = 8;
if ( ( *p | 0x20 ) == 'x' ) {
p++;
base = 16;
}
}
}