From d0a3c64fb4af21a911f2b7553bbddb45dd9e4484 Mon Sep 17 00:00:00 2001 From: ocean Date: Fri, 17 Feb 2006 02:21:39 +0000 Subject: * util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330] * pack.c (EXTEND32): unpack("l") did not work where sizeof(long) != 4. [ruby-talk:180024] * pack.c (pack_unpack): fixed integer overflow on template "w". [ruby-talk:180126] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 5eaee4cb0b..953927d145 100644 --- a/util.c +++ b/util.c @@ -848,9 +848,15 @@ ruby_strtod( } expSign = FALSE; } - while (ISDIGIT(*p)) { - exp = exp * 10 + (*p - '0'); - p += 1; + if (ISDIGIT(*p)) { + do { + exp = exp * 10 + (*p - '0'); + p += 1; + } + while (ISDIGIT(*p)); + } + else { + p = pExp; } } if (expSign) { -- cgit v1.2.3