summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/strtod.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2007-12-16 21:14:33 +0000
committerdas <das@FreeBSD.org>2007-12-16 21:14:33 +0000
commit70cdf6a57447192c3b77090ed112c732882f95f3 (patch)
tree5f9e7a4fd4b4e74b456608617e283e71285fad2f /contrib/gdtoa/strtod.c
parentb2367c2d0b77fb617f31b9fafae0c52dc8ecf89e (diff)
downloadFreeBSD-src-70cdf6a57447192c3b77090ed112c732882f95f3.zip
FreeBSD-src-70cdf6a57447192c3b77090ed112c732882f95f3.tar.gz
Fix strto{f,d,ld}() so they don't return signaling NaNs. C99
says they are never supposed to, and the fact that they did could cause apps that run with unmasked FP exceptions to SIGFPE after a scanf() or strtod(). The vendor stated that he will not be fixing this, citing portability concerns.
Diffstat (limited to 'contrib/gdtoa/strtod.c')
-rw-r--r--contrib/gdtoa/strtod.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/gdtoa/strtod.c b/contrib/gdtoa/strtod.c
index 66a3baa..3703f94 100644
--- a/contrib/gdtoa/strtod.c
+++ b/contrib/gdtoa/strtod.c
@@ -29,6 +29,8 @@ THIS SOFTWARE.
/* Please send bug reports to David M. Gay (dmg at acm dot org,
* with " at " changed at "@" and " dot " changed to "."). */
+/* $FreeBSD$ */
+
#include "gdtoaimp.h"
#ifndef NO_FENV_H
#include <fenv.h>
@@ -258,7 +260,7 @@ strtod
if (*s == '(' /*)*/
&& hexnan(&s, &fpinan, bits)
== STRTOG_NaNbits) {
- word0(rv) = 0x7ff00000 | bits[1];
+ word0(rv) = 0x7ff80000 | bits[1];
word1(rv) = bits[0];
}
else {
OpenPOWER on IntegriCloud