From 27a5bb33ac41b838dd3c4ebdc3a75a6ad666dfc7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 7 Apr 1998 16:28:09 +0000 Subject: Update. 1998-04-07 16:18 Ulrich Drepper * libc.map: Add __asprintf to GLIBC_2.1. * elf/dlerror.c: Use __asprintf, not asprintf. * libio/stdio.h: Declare __asprintf. * stdio-common/asprintf.c: Define as __asprintf and make asprintf a weak alias. * elf/dl-minimal.c: Add definition of strtol and strtoul (und friends) to avoid inclusion from libc_pic.a. * elf/dl-runtime.c: Undo last patch. * stdlib/strtod.c: Don't use mbtowc, use btowc. * sysdeps/i386/dl-machine.h (dl_platform_init): Don't use "i386" as default, use NULL. --- stdlib/strtod.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'stdlib/strtod.c') diff --git a/stdlib/strtod.c b/stdlib/strtod.c index 061cedc98a..a06239d123 100644 --- a/stdlib/strtod.c +++ b/stdlib/strtod.c @@ -88,10 +88,12 @@ # define LOCALE_PARAM_DECL #endif +#if defined _LIBC || defined HAVE_WCHAR_H +# include +#endif #ifdef USE_WIDE_CHAR # include -# include # define STRING_TYPE wchar_t # define CHAR_TYPE wint_t # define L_(Ch) L##Ch @@ -440,7 +442,7 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM) /* The radix character of the current locale. */ wchar_t decimal; /* The thousands character of the current locale. */ - wchar_t thousands; + wchar_t thousands = L'\0'; /* The numeric grouping specification of the current locale, in the format described in . */ const char *grouping; @@ -457,18 +459,17 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM) else { /* Figure out the thousands separator character. */ - if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP), - strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0) - thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP); +#if defined _LIBC || defined _HAVE_BTOWC + thousands = btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + if (thousands == WEOF) + thousands = L'\0'; +#endif if (thousands == L'\0') grouping = NULL; } } else - { - grouping = NULL; - thousands = L'\0'; - } + grouping = NULL; /* Find the locale's decimal point character. */ if (mbtowc ((wchar_t *) &decimal, _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT), -- cgit v1.2.3