projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
39a6cba
)
Fix memory leak in get_system_decimal().
author
Ben Pfaff
<blp@gnu.org>
Tue, 25 Nov 2008 06:12:01 +0000
(22:12 -0800)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 30 Nov 2008 23:27:42 +0000
(15:27 -0800)
src/libpspp/i18n.c
patch
|
blob
|
history
diff --git
a/src/libpspp/i18n.c
b/src/libpspp/i18n.c
index bda2676c86788eabcfa24a937f7802cbe19c955d..db851217c80be27ae129a9c6252824929af51785 100644
(file)
--- a/
src/libpspp/i18n.c
+++ b/
src/libpspp/i18n.c
@@
-225,24
+225,24
@@
i18n_done (void)
char
get_system_decimal (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
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
{
#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);
}
#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;
}
}