2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 07:11:32 +00:00

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

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;
}
}
}