Skip to content
Snippets Groups Projects
Commit 6e8085b4 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py: Fix base "detection" for int('0<hexdigit>', 16).

parent 7b0f9a7d
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment