From a258d6f4157908b8360ee005b20bddb0969ce0aa Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 15 Mar 2012 06:04:56 +0000 Subject: * util.c (ruby_strtod): no need to check same digit for hexdigit twice. [ruby-dev:45363][Bug #6146] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 39ec3e9783..fca9e67541 100644 --- a/util.c +++ b/util.c @@ -1977,8 +1977,11 @@ break2: nd0 = -4; if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0; - while (*s == '0') s++; - if ((s1 = strchr(hexdigit, *s)) != NULL) { + if (*s == '0') { + while (*++s == '0'); + s1 = strchr(hexdigit, *s); + } + if (s1 != NULL) { do { adj += aadj * ((s1 - hexdigit) & 15); nd0 += 4; -- cgit v1.2.1