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
|
else
|
||||||
bar = 0;
|
bar = 0;
|
||||||
|
|
||||||
if (pl->bar == NULL) {
|
if (pl->bar == NULL)
|
||||||
pl->bar = malloc(sizeof(char *) * pl->num_datasets);
|
pl->bar = calloc(sizeof(char *), pl->num_datasets);
|
||||||
memset(pl->bar, 0, sizeof(char*) * pl->num_datasets);
|
|
||||||
}
|
|
||||||
if (pl->bar[bar] == NULL) {
|
if (pl->bar[bar] == NULL) {
|
||||||
pl->bar[bar] = malloc(pl->width);
|
pl->bar[bar] = malloc(pl->width);
|
||||||
memset(pl->bar[bar], 0, pl->width);
|
memset(pl->bar[bar], 0, pl->width);
|
||||||
|
Loading…
Reference in New Issue
Block a user