From: Paul Eggert Date: Wed, 8 Sep 2004 17:16:57 +0000 (+0000) Subject: (C_STRTOD) [!defined LC_ALL_MASK]: Set LC_ALL to "C", X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cebd8c7494b94d0466e115bb76df80499bd99b2;p=pspp (C_STRTOD) [!defined LC_ALL_MASK]: Set LC_ALL to "C", not just LC_NUMERIC, to avoid the unlikely possibility of mixed locales screwing things up. This removes an inconsistency with the LC_ALL_MASK case. --- diff --git a/lib/c-strtod.c b/lib/c-strtod.c index ae0511034d..c9ebb8091b 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); }