diff options
author | das <das@FreeBSD.org> | 2004-01-19 05:14:12 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2004-01-19 05:14:12 +0000 |
commit | 2b54587e529691da13ad420858ce167f84023ce5 (patch) | |
tree | f5a48ebe72bfd4596e9dc99161743ce8c7dfc2cc /contrib/gdtoa/strtod.c | |
parent | ac4cce98d01fbe19f88ac1e217e7895ec38fdbac (diff) | |
download | FreeBSD-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.c | 8 |
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; |