diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-02-17 23:20:19 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-02-17 23:20:19 +0000 |
commit | 7e8dfdf113000b76207e8b56e9bcf96d6044759a (patch) | |
tree | d00ee7e4cfd8c40fbe2de807285694988531c123 /usr.bin/ministat | |
parent | 5da74e04ecafef8004d5f3c35a6085284c6f4d48 (diff) |
ministat(1): replace malloc + memset with calloc.
Reviewed by: phk
Notes
Notes:
svn path=/head/; revision=278928
Diffstat (limited to 'usr.bin/ministat')
-rw-r--r-- | usr.bin/ministat/ministat.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index c8d8e12355c9..4c0ddd056a64 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -329,10 +329,8 @@ PlotSet(struct dataset *ds, int val) else bar = 0; - if (pl->bar == NULL) { - pl->bar = malloc(sizeof(char *) * pl->num_datasets); - memset(pl->bar, 0, sizeof(char*) * pl->num_datasets); - } + if (pl->bar == NULL) + pl->bar = calloc(sizeof(char *), pl->num_datasets); if (pl->bar[bar] == NULL) { pl->bar[bar] = malloc(pl->width); memset(pl->bar[bar], 0, pl->width); |