Date: Tue, 17 Feb 2015 23:20:19 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278928 - head/usr.bin/ministat Message-ID: <201502172320.t1HNKJDs001089@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Tue Feb 17 23:20:19 2015 New Revision: 278928 URL: https://svnweb.freebsd.org/changeset/base/278928 Log: ministat(1): replace malloc + memset with calloc. Reviewed by: phk Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Tue Feb 17 23:14:26 2015 (r278927) +++ head/usr.bin/ministat/ministat.c Tue Feb 17 23:20:19 2015 (r278928) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502172320.t1HNKJDs001089>