http://git.etherboot.org
/
people
/
xl0
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbfb2e0
)
May as well add octal support to strtoul()
author
Michael Brown
<mcb30@etherboot.org>
Wed, 15 Nov 2006 02:57:24 +0000
(
02:57
+0000)
committer
Michael Brown
<mcb30@etherboot.org>
Wed, 15 Nov 2006 02:57:24 +0000
(
02:57
+0000)
src/core/misc.c
patch
|
blob
|
history
diff --git
a/src/core/misc.c
b/src/core/misc.c
index
968e232
..
2a92631
100644
(file)
--- 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;
+ }
}
}