diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-12-10 01:52:21 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-12-10 01:52:21 +0000 |
commit | 405698e946dbed472491f85867eb511eb080e05a (patch) | |
tree | d978783b1096fcc700943d532afced86f5a702e5 /stdlib/strtod_l.c | |
parent | 2282c90c4298988b61d2487549167c39d76ec7bc (diff) | |
download | glibc-405698e946dbed472491f85867eb511eb080e05a.zip glibc-405698e946dbed472491f85867eb511eb080e05a.tar.gz glibc-405698e946dbed472491f85867eb511eb080e05a.tar.bz2 |
[BZ #3664]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize
empty parsed strings.
* stdlib/Makefile (tests): Add tst-strtod2.
* stdlib/tst-strtod2.c: New file.
Diffstat (limited to 'stdlib/strtod_l.c')
-rw-r--r-- | stdlib/strtod_l.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c index 6f7e62f..b926aeb 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, |