From c713eaa60353b6f1bc562075efcbe0720233249e Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sat, 21 Jun 2008 19:27:54 +0000 Subject: [PATCH] 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 MFC after: 1 week --- contrib/gdtoa/gethex.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/gdtoa/gethex.c b/contrib/gdtoa/gethex.c index 610f74735e9..f130fd53112 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++;