diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-10 04:42:56 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-10 04:45:15 +0300 |
commit | 6e8085b425a9d02ac3e204651e2c9d8de9a23a85 (patch) | |
tree | 40c6b145bf2b01b574940d1cb1dfe046d792d3de /py | |
parent | 7b0f9a7d9b8a119093ea31c78368b5314bbf23a7 (diff) | |
download | micropython-6e8085b425a9d02ac3e204651e2c9d8de9a23a85.tar.gz micropython-6e8085b425a9d02ac3e204651e2c9d8de9a23a85.zip |
py: Fix base "detection" for int('0<hexdigit>', 16).
Diffstat (limited to 'py')
-rw-r--r-- | py/parsenumbase.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/py/parsenumbase.c b/py/parsenumbase.c index 819b6655ba..0057e467e5 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -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') { |