summary refs log tree commit diff
path: root/stdlib/strtof_l.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-05-23 18:00:10 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-08-29 12:22:10 +0200
commit0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b (patch)
treeb3c86dbee5b95c24a8413be634ae11318ceb2f8e /stdlib/strtof_l.c
parentf1cc4c8654b6bc431273286d3562942c50975caf (diff)
downloadglibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.tar.gz
glibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.tar.xz
glibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.zip
[BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
Diffstat (limited to 'stdlib/strtof_l.c')
-rw-r--r--stdlib/strtof_l.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/stdlib/strtof_l.c b/stdlib/strtof_l.c
index 6fb44bd403..c4c1c1f2dd 100644
--- a/stdlib/strtof_l.c
+++ b/stdlib/strtof_l.c
@@ -37,10 +37,9 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **,
 #define SET_MANTISSA(flt, mant) \
   do { union ieee754_float u;						      \
        u.f = (flt);							      \
-       if ((mant & 0x7fffff) == 0)					      \
-	 mant = 0x400000;						      \
-       u.ieee.mantissa = (mant) & 0x7fffff;				      \
-       (flt) = u.f;							      \
+       u.ieee_nan.mantissa = (mant);					      \
+       if (u.ieee.mantissa != 0)					      \
+	 (flt) = u.f;							      \
   } while (0)
 
 #include "strtod_l.c"