From 8b341cb27a304f5824c9579793cebd67c22cc2d9 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 17 Jul 2006 15:43:47 +0000 Subject: * util.c (ruby_strtod): stop at dot not followed by digits. fixed: [ruby-dev:29035] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 449d4bf439..6c18543347 100644 --- a/util.c +++ b/util.c @@ -783,9 +783,9 @@ ruby_strtod(string, endPtr) * and also locate the decimal point. */ - for ( ; c = *p; p++) { + for ( ; (c = *p) != '\0'; p++) { if (!ISDIGIT(c)) { - if (c != '.' || hasPoint) { + if (c != '.' || hasPoint || !ISDIGIT(p[1])) { break; } hasPoint = Qtrue; -- cgit v1.2.3