aboutsummaryrefslogtreecommitdiff
path: root/contrib/gdtoa
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2008-06-21 19:27:54 +0000
committerDavid Schultz <das@FreeBSD.org>2008-06-21 19:27:54 +0000
commitc713eaa60353b6f1bc562075efcbe0720233249e (patch)
treeb45e227573b571ff6ae5914ef1a8040e59b272f5 /contrib/gdtoa
parent0ee1368a961e82066e8ee940f85bbe9cd911c4c1 (diff)
downloadsrc-c713eaa60353b6f1bc562075efcbe0720233249e.tar.gz
src-c713eaa60353b6f1bc562075efcbe0720233249e.zip
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
Notes
Notes: svn path=/head/; revision=179918
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 610f74735e98..f130fd531125 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++;