X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flibpspp%2Fi18n.c;h=db851217c80be27ae129a9c6252824929af51785;hb=ca7da17a401e015805db0ea70234c267d67535a3;hp=bda2676c86788eabcfa24a937f7802cbe19c955d;hpb=c3ac5a8af9c449072c7e872ca70a78c1755ae309;p=pspp-builds.git diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index bda2676c..db851217 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -225,24 +225,24 @@ i18n_done (void) char get_system_decimal (void) { - char *radix_char = NULL; + char radix_char; char *ol = setlocale (LC_NUMERIC, NULL); setlocale (LC_NUMERIC, ""); #if HAVE_NL_LANGINFO - radix_char = nl_langinfo (RADIXCHAR); + radix_char = nl_langinfo (RADIXCHAR)[0]; #else { - char *buf = xmalloc (10); - snprintf (buf, 10, "%f", 2.5); - radix_char = &buf[1]; + char buf[10]; + snprintf (buf, sizeof buf, "%f", 2.5); + radix_char = buf[1]; } #endif /* We MUST leave LC_NUMERIC untouched, since it would otherwise interfere with data_{in,out} */ setlocale (LC_NUMERIC, ol); - return *radix_char; + return radix_char; }