diff options
| author | Xin LI <delphij@FreeBSD.org> | 2008-04-13 08:05:08 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2008-04-13 08:05:08 +0000 |
| commit | 92226c92f3ab73e2e3d3aec141486c3cafbbcfcd (patch) | |
| tree | daae6c76360280a45fec224625b0f208c2bcf62d /lib/libc/stdlib/strfmon.c | |
| parent | 722bb568022e4e02def16d48c57300ce874f0cc8 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/strfmon.c')
| -rw-r--r-- | lib/libc/stdlib/strfmon.c | 3 |
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 */ |
