about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/Makefile2
-rw-r--r--stdlib/strtod_l.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5387475400..37400ec547 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -67,7 +67,7 @@ tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv   \
 		   tst-xpg-basename tst-random tst-random2 tst-bsearch	    \
 		   tst-limits tst-rand48 bug-strtod tst-setcontext	    \
 		   test-a64l tst-qsort tst-system testmb2 bug-strtod2	    \
-		   tst-atof1 tst-atof2
+		   tst-atof1 tst-atof2 tst-strtod2
 
 include ../Makeconfig
 
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 6f7e62fbb8..b926aeba56 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -662,20 +662,20 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
   /* If no other digit but a '0' is found the result is 0.0.
      Return current read pointer.  */
-  if ((c < L_('0') || c > L_('9'))
-      && (base == 16 && (c < (CHAR_TYPE) TOLOWER (L_('a'))
-			 || c > (CHAR_TYPE) TOLOWER (L_('f'))))
+  if (!((c >= L_('0') && c <= L_('9'))
+	|| (base == 16 && ((CHAR_TYPE) TOLOWER (c) >= L_('a')
+			   && (CHAR_TYPE) TOLOWER (c) <= L_('f')))
 #ifdef USE_WIDE_CHAR
-      && c != (wint_t) decimal
+	|| c == (wint_t) decimal
 #else
-      && ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
+	|| ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
 	      if (decimal[cnt] != cp[cnt])
 		break;
-	    decimal[cnt] != '\0'; })
+	      decimal[cnt] == '\0'; })
 #endif
-      && (base == 16 && (cp == start_of_digits
-			 || (CHAR_TYPE) TOLOWER (c) != L_('p')))
-      && (base != 16 && (CHAR_TYPE) TOLOWER (c) != L_('e')))
+	|| (base == 16 && (cp != start_of_digits
+			   && (CHAR_TYPE) TOLOWER (c) == L_('p')))
+	|| (base != 16 && (CHAR_TYPE) TOLOWER (c) == L_('e'))))
     {
 #ifdef USE_WIDE_CHAR
       tp = __correctly_grouped_prefixwc (start_of_digits, cp, thousands,