mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
May as well add octal support to strtoul()
This commit is contained in:
@@ -155,11 +155,14 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
|
|||||||
unsigned int charval;
|
unsigned int charval;
|
||||||
|
|
||||||
if ( base == 0 ) {
|
if ( base == 0 ) {
|
||||||
if ( ( p[0] == '0' ) && ( ( p[1] | 0x20 ) == 'x' ) ) {
|
base = 10;
|
||||||
base = 16;
|
if ( *p == '0' ) {
|
||||||
p += 2;
|
p++;
|
||||||
} else {
|
base = 8;
|
||||||
base = 10;
|
if ( ( *p | 0x20 ) == 'x' ) {
|
||||||
|
p++;
|
||||||
|
base = 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user