summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-18 05:53:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-18 05:53:53 +0000
commit587e7ac7e7b36f80022d3959a0c6b9fa4aaf23a9 (patch)
treeb723afca8ad8b0fa3f28a5192db84ff762efee52 /bignum.c
parentb1e4030244ddbaadd22f4ca01512cb22fba1771b (diff)
* bignum.c (rb_cstr_to_inum): should not erase all 0s, but
squeeze into one. [ruby-dev:19377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 c010bf7046..16cb8e1602 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)) {