summaryrefslogtreecommitdiff
path: root/py/parsenum.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/parsenum.c')
-rw-r--r--py/parsenum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/parsenum.c b/py/parsenum.c
index 7e6695fbf..31b332c18 100644
--- a/py/parsenum.c
+++ b/py/parsenum.c
@@ -99,10 +99,10 @@ mp_obj_t mp_parse_num_integer(const char *restrict str_, size_t len, int base, m
}
// add next digi and check for overflow
- if (mp_small_int_mul_overflow(int_val, base)) {
+ if (mp_small_int_mul_overflow(int_val, base, &int_val)) {
goto overflow;
}
- int_val = int_val * base + dig;
+ int_val += dig;
if (!MP_SMALL_INT_FITS(int_val)) {
goto overflow;
}