ministat(1): replace malloc + memset with calloc.

Reviewed by:	phk
This commit is contained in:
Pedro F. Giffuni 2015-02-17 23:20:19 +00:00
parent 5da74e04ec
commit 7e8dfdf113
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278928

View File

@ -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);