mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
ministat(1): replace malloc + memset with calloc.
Reviewed by: phk
This commit is contained in:
parent
5da74e04ec
commit
7e8dfdf113
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278928
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue