summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index c010bf7..16cb8e1 100644
--- a/bignum.c
+++ b/bignum.c
@@ -392,8 +392,10 @@ rb_cstr_to_inum(str, base, badcheck)
}
break;
}
- while (*str == '0') str++; /* squeeze preceeding 0s */
-
+ if (*str == '0') { /* squeeze preceeding 0s */
+ while (*++str == '0');
+ --str;
+ }
len *= strlen(str)*sizeof(char);
if (len <= (sizeof(VALUE)*CHAR_BIT)) {