aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/strtod.c
diff options
context:
space:
mode:
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 f1a0c0495786..4913d5089c94 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;