summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-09-08 17:00:24 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-09-08 17:00:24 +0000
commit248313ef6a6935a72daaa9e07bc4f45bc37ecb9f (patch)
tree867e7b41e2bb1265d87eb0591116d5f0a9efba7d
parent0e0adc63250f7ab01232d8352915bbba83c3818b (diff)
downloadcoreutils-248313ef6a6935a72daaa9e07bc4f45bc37ecb9f.tar.xz
(C_STRTOD): Set LC_ALL to "C", not just LC_NUMERIC, to avoid the
unlikely possibility of mixed locales screwing things up.
-rw-r--r--lib/c-strtod.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/c-strtod.c b/lib/c-strtod.c
index ae0511034..c9ebb8091 100644
--- a/lib/c-strtod.c
+++ b/lib/c-strtod.c
@@ -59,19 +59,19 @@ C_STRTOD (char const *nptr, char **endptr)
#else
- char *saved_locale = setlocale (LC_NUMERIC, NULL);
+ char *saved_locale = setlocale (LC_ALL, NULL);
if (saved_locale)
{
saved_locale = xstrdup (saved_locale);
- setlocale (LC_NUMERIC, "C");
+ setlocale (LC_ALL, "C");
}
r = STRTOD (nptr, endptr);
if (saved_locale)
{
- setlocale (LC_NUMERIC, saved_locale);
+ setlocale (LC_ALL, saved_locale);
free (saved_locale);
}