summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/strfmon.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2008-04-13 08:05:08 +0000
committerXin LI <delphij@FreeBSD.org>2008-04-13 08:05:08 +0000
commit92226c92f3ab73e2e3d3aec141486c3cafbbcfcd (patch)
treedaae6c76360280a45fec224625b0f208c2bcf62d /lib/libc/stdlib/strfmon.c
parent722bb568022e4e02def16d48c57300ce874f0cc8 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/strfmon.c')
-rw-r--r--lib/libc/stdlib/strfmon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c
index db78232a07da..7ebded7a4c0c 100644
--- a/lib/libc/stdlib/strfmon.c
+++ b/lib/libc/stdlib/strfmon.c
@@ -535,12 +535,11 @@ __format_grouped_double(double value, int *flags,
/* make sure that we've enough space for result string */
bufsize = strlen(avalue)*2+1;
- rslt = malloc(bufsize);
+ rslt = calloc(1, bufsize);
if (rslt == NULL) {
free(avalue);
return (NULL);
}
- memset(rslt, 0, bufsize);
bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */
/* skip spaces at beggining */