diff options
author | Michael Brown <mcb30@etherboot.org> | 2006-11-15 02:57:24 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2006-11-15 02:57:24 +0000 |
commit | 5753f2c58b9559cea178d9e424a337e37cc7fce4 (patch) | |
tree | 715a7cbe8021c881376960bcfcd979a1d54ea635 /src/core/misc.c | |
parent | bbfb2e02fd5522df7acd537dc0b9e80f022f1f96 (diff) | |
download | ipxe-5753f2c58b9559cea178d9e424a337e37cc7fce4.tar.gz |
May as well add octal support to strtoul()
Diffstat (limited to 'src/core/misc.c')
-rw-r--r-- | src/core/misc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/misc.c b/src/core/misc.c index 968e232d..2a926313 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -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; + } } } |