summary refs log tree commit diff
path: root/stdlib/strtod.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-07 16:28:09 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-07 16:28:09 +0000
commit27a5bb33ac41b838dd3c4ebdc3a75a6ad666dfc7 (patch)
treed91c99e57babfeaf64a8d686fdadd935a0c50866 /stdlib/strtod.c
parent6ca96fe202d5031bd34794b81798651a07839075 (diff)
downloadglibc-27a5bb33ac41b838dd3c4ebdc3a75a6ad666dfc7.tar.gz
glibc-27a5bb33ac41b838dd3c4ebdc3a75a6ad666dfc7.tar.xz
glibc-27a5bb33ac41b838dd3c4ebdc3a75a6ad666dfc7.zip
Update.
1998-04-07 16:18  Ulrich Drepper  <drepper@cygnus.com>

	* 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.
Diffstat (limited to 'stdlib/strtod.c')
-rw-r--r--stdlib/strtod.c19
1 files changed, 10 insertions, 9 deletions
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 <wchar.h>
+#endif
 
 #ifdef USE_WIDE_CHAR
 # include <wctype.h>
-# include <wchar.h>
 # 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 <locale.h>.  */
   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),