summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib')
-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 db78232..7ebded7 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 */
OpenPOWER on IntegriCloud