summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2008-04-13 08:05:08 +0000
committerdelphij <delphij@FreeBSD.org>2008-04-13 08:05:08 +0000
commitb612c0d58d0d1f801204c5207700978b731b7d02 (patch)
treedaae6c76360280a45fec224625b0f208c2bcf62d /lib
parent1aaa158b9c56f130e92dcb5ed4381f37e0585b1c (diff)
downloadFreeBSD-src-b612c0d58d0d1f801204c5207700978b731b7d02.zip
FreeBSD-src-b612c0d58d0d1f801204c5207700978b731b7d02.tar.gz
Use calloc() instaed of zeroing memory ourselves.
Diffstat (limited to 'lib')
-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