summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/strtod.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2004-01-19 05:14:12 +0000
committerdas <das@FreeBSD.org>2004-01-19 05:14:12 +0000
commit2b54587e529691da13ad420858ce167f84023ce5 (patch)
treef5a48ebe72bfd4596e9dc99161743ce8c7dfc2cc /contrib/gdtoa/strtod.c
parentac4cce98d01fbe19f88ac1e217e7895ec38fdbac (diff)
downloadFreeBSD-src-2b54587e529691da13ad420858ce167f84023ce5.zip
FreeBSD-src-2b54587e529691da13ad420858ce167f84023ce5.tar.gz
Import gdtoa 20040118. This revision addresses some corner cases in
denormal and locale handling in strtod().
Diffstat (limited to 'contrib/gdtoa/strtod.c')
-rw-r--r--contrib/gdtoa/strtod.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/gdtoa/strtod.c b/contrib/gdtoa/strtod.c
index f1a0c04..4913d50 100644
--- a/contrib/gdtoa/strtod.c
+++ b/contrib/gdtoa/strtod.c
@@ -114,15 +114,17 @@ strtod
switch(s[1]) {
case 'x':
case 'X':
- switch(i = gethex(&s, &fpi, &exp, &bb, sign)) {
+ switch((i = gethex(&s, &fpi, &exp, &bb, sign)) & STRTOG_Retmask) {
case STRTOG_NoNumber:
s = s00;
sign = 0;
case STRTOG_Zero:
break;
default:
- copybits(bits, fpi.nbits, bb);
- Bfree(bb);
+ if (bb) {
+ copybits(bits, fpi.nbits, bb);
+ Bfree(bb);
+ }
ULtod(((U*)&rv)->L, bits, exp, i);
}
goto ret;
OpenPOWER on IntegriCloud