|
@ -629,17 +629,22 @@ unsigned int strtoui_nospace(const char *str, int base) |
|
|
if (*str == '0') |
|
|
if (*str == '0') |
|
|
{ |
|
|
{ |
|
|
str++; |
|
|
str++; |
|
|
if (*str == 'x' || *str == 'X') |
|
|
switch (*str) |
|
|
{ |
|
|
{ |
|
|
|
|
|
case 'X': |
|
|
|
|
|
case 'x': |
|
|
str++; |
|
|
str++; |
|
|
base = 16; |
|
|
base = 16; |
|
|
} |
|
|
break; |
|
|
else if (*str == 'b' || *str == 'B') |
|
|
case 'B': |
|
|
{ |
|
|
case 'b': |
|
|
str++; |
|
|
str++; |
|
|
base = 2; |
|
|
base = 2; |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
base = 8; |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
else base = 8; |
|
|
|
|
|
} |
|
|
} |
|
|
else base = 10; |
|
|
else base = 10; |
|
|
} |
|
|
} |
|
@ -752,19 +757,24 @@ unsigned int strtoui_nospace_s(const char *str, size_t length, int base) |
|
|
{ |
|
|
{ |
|
|
if (--length == 0) return total; |
|
|
if (--length == 0) return total; |
|
|
str++; |
|
|
str++; |
|
|
if (*str == 'x' || *str == 'X') |
|
|
switch (*str) |
|
|
{ |
|
|
{ |
|
|
|
|
|
case 'X': |
|
|
|
|
|
case 'x': |
|
|
if (--length == 0) return total; |
|
|
if (--length == 0) return total; |
|
|
str++; |
|
|
str++; |
|
|
base = 16; |
|
|
base = 16; |
|
|
} |
|
|
break; |
|
|
else if (*str == 'b' || *str == 'B') |
|
|
case 'B': |
|
|
{ |
|
|
case 'b': |
|
|
if (--length == 0) return total; |
|
|
if (--length == 0) return total; |
|
|
str++; |
|
|
str++; |
|
|
base = 2; |
|
|
base = 2; |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
base = 8; |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
else base = 8; |
|
|
|
|
|
} |
|
|
} |
|
|
else base = 10; |
|
|
else base = 10; |
|
|
} |
|
|
} |
|
|