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

This commit is contained in:
Paul Sokolovsky
2014-05-10 04:42:56 +03:00
parent 7b0f9a7d9b
commit 6e8085b425
2 changed files with 4 additions and 1 deletions

View File

@@ -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') {