summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/string.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index a3f337d4b..2b01cc3a5 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2153,6 +2153,8 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b
break;
}
}
+ if (*(p - 1) == '0')
+ p--;
}
if (p == pend) {
if (badcheck) goto bad;