diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-03-26 10:04:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-03-26 10:04:40 +0000 |
commit | f6e29e076a1e0662faff14e7fe23235f4a834ff6 (patch) | |
tree | bd691d9de38537fac2e958561cca369f446a2267 /newlib/libc/stdlib/wcstod.c | |
parent | 7ca98b490133315b2b999c56eff604b655f062c0 (diff) | |
download | cygnal-f6e29e076a1e0662faff14e7fe23235f4a834ff6.tar.gz cygnal-f6e29e076a1e0662faff14e7fe23235f4a834ff6.tar.bz2 cygnal-f6e29e076a1e0662faff14e7fe23235f4a834ff6.zip |
Revert erroneously checked in files.
Diffstat (limited to 'newlib/libc/stdlib/wcstod.c')
-rw-r--r-- | newlib/libc/stdlib/wcstod.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/newlib/libc/stdlib/wcstod.c b/newlib/libc/stdlib/wcstod.c index ca1f0b5ab..11fb922b1 100644 --- a/newlib/libc/stdlib/wcstod.c +++ b/newlib/libc/stdlib/wcstod.c @@ -116,10 +116,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, #include <_ansi.h> #include <errno.h> #include <stdlib.h> -#include <string.h> #include <wchar.h> #include <wctype.h> -#include <locale.h> #include <math.h> double @@ -169,25 +167,9 @@ _DEFUN (_wcstod_r, (ptr, nptr, endptr), * where it ended, count multibyte characters to find the * corresponding position in the wide char string. */ - if (endptr != NULL) { - /* The only valid multibyte char in a float converted by - strtod/wcstod is the radix char. What we do here is, - figure out if the radix char was in the valid leading - float sequence in the incoming string. If so, the - multibyte float string is strlen(radix char) - 1 bytes - longer than the incoming wide char string has characters. - To fix endptr, reposition end as if the radix char was - just one byte long. The resulting difference (end - buf) - is then equivalent to the number of valid wide characters - in the input string. */ - len = strlen (localeconv ()->decimal_point); - if (len > 1) { - char *d = strstr (buf, localeconv ()->decimal_point); - if (d && d < end) - end -= len - 1; - } + if (endptr != NULL) + /* XXX Assume each wide char is one byte. */ *endptr = (wchar_t *)nptr + (end - buf); - } _free_r(ptr, buf); |