Fixed a bug which manifested itself when running a Mingw compiled
binary with a non-english locale. setlocale returns a statically
allocated string, so it's valid only until the next call to setlocale.
Thanks to Michel Boaventura for reporting and helping to diagnose this
problem.
{
char radix_char;
- char *ol = setlocale (LC_NUMERIC, NULL);
+ char *ol = strdup (setlocale (LC_NUMERIC, NULL));
setlocale (LC_NUMERIC, "");
#if HAVE_NL_LANGINFO
/* We MUST leave LC_NUMERIC untouched, since it would
otherwise interfere with data_{in,out} */
setlocale (LC_NUMERIC, ol);
+ free (ol);
return radix_char;
}