summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2008-06-21 19:27:54 +0000
committerdas <das@FreeBSD.org>2008-06-21 19:27:54 +0000
commite839fcc5eec1307e0375ca235fb9479a7ff9449f (patch)
treeb45e227573b571ff6ae5914ef1a8040e59b272f5 /contrib/gdtoa
parent2d03a1918bd34dbff4beaad25c10d8f46b01e562 (diff)
downloadFreeBSD-src-e839fcc5eec1307e0375ca235fb9479a7ff9449f.zip
FreeBSD-src-e839fcc5eec1307e0375ca235fb9479a7ff9449f.tar.gz
Bring in the vendor's fix for a bug in strtod() whereby
strtod("0xyz", &endp) resulted in endp pointing to "0xyz" instead of "xyz". Reported by: Tony Finch <dot@dotat.at> MFC after: 1 week
Diffstat (limited to 'contrib/gdtoa')
-rw-r--r--contrib/gdtoa/gethex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/gdtoa/gethex.c b/contrib/gdtoa/gethex.c
index 610f747..f130fd5 100644
--- a/contrib/gdtoa/gethex.c
+++ b/contrib/gdtoa/gethex.c
@@ -113,8 +113,11 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign)
e += e1;
}
*sp = (char*)s;
- if (zret)
- return havedig ? STRTOG_Zero : STRTOG_NoNumber;
+ if (zret) {
+ if (!havedig)
+ *sp = s0 - 1;
+ return STRTOG_Zero;
+ }
n = s1 - s0 - 1;
for(k = 0; n > 7; n >>= 1)
k++;
OpenPOWER on IntegriCloud