mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 03:15:06 +00:00
Merge "Make strtoi() do the right thing for base==16"
This commit is contained in:
@@ -88,11 +88,11 @@ int strtoi(const char *nptr, char **endptr, int base)
|
||||
|
||||
while((c = *nptr++) && isspace(c)) {}
|
||||
|
||||
if (c == '0' && *nptr == 'x' && (base == 0 || base == 16)) {
|
||||
if (c == '0' && *nptr == 'x') {
|
||||
base = 16;
|
||||
c = nptr[1];
|
||||
nptr += 2;
|
||||
} else {
|
||||
} else if (base == 0) {
|
||||
base = 10;
|
||||
if (c == '-') {
|
||||
neg = 1;
|
||||
|
||||
Reference in New Issue
Block a user