py: Fix base "detection" for int('0<hexdigit>', 16).
This commit is contained in:
parent
7b0f9a7d9b
commit
6e8085b425
@ -42,7 +42,9 @@ int mp_parse_num_base(const char *str, uint len, int *base) {
|
||||
} else if (*base == 0 && (c | 32) == 'b') {
|
||||
*base = 2;
|
||||
} else {
|
||||
*base = 10;
|
||||
if (*base == 0) {
|
||||
*base = 10;
|
||||
}
|
||||
p -= 2;
|
||||
}
|
||||
} else if (*base == 8 && c == '0') {
|
||||
|
@ -37,6 +37,7 @@ print(int('0o123', 0))
|
||||
print(int('8388607'))
|
||||
print(int('0x123', 16))
|
||||
print(int('0X123', 16))
|
||||
print(int('0A', 16))
|
||||
print(int('0o123', 8))
|
||||
print(int('0O123', 8))
|
||||
print(int('0123', 8))
|
||||
|
Loading…
Reference in New Issue
Block a user