diff options
author | delphij <delphij@FreeBSD.org> | 2009-05-21 23:00:20 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-05-21 23:00:20 +0000 |
commit | bb37baaeedaff3e1838e01e90e32fcec4046d8fc (patch) | |
tree | e0691f3853c398368769dcf402a481fb7b9fb273 /usr.sbin/iostat | |
parent | ef0e39838cdddd0a050935c47b5336a64283d9ed (diff) | |
download | FreeBSD-src-bb37baaeedaff3e1838e01e90e32fcec4046d8fc.zip FreeBSD-src-bb37baaeedaff3e1838e01e90e32fcec4046d8fc.tar.gz |
Use calloc().
Diffstat (limited to 'usr.sbin/iostat')
-rw-r--r-- | usr.sbin/iostat/iostat.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 40d78ab..65a0386 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -311,16 +311,13 @@ main(int argc, char **argv) } } - cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); + cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); if (cur.dinfo == NULL) - err(1, "malloc failed"); + err(1, "calloc failed"); - last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); + last.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); if (last.dinfo == NULL) - err(1, "malloc failed"); - - bzero(cur.dinfo, sizeof(struct devinfo)); - bzero(last.dinfo, sizeof(struct devinfo)); + err(1, "calloc failed"); /* * Grab all the devices. We don't look to see if the list has |