summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2008-03-05 23:17:19 +0000
committerdelphij <delphij@FreeBSD.org>2008-03-05 23:17:19 +0000
commit365714faf01db2ded25f8ecdc958a159aca06437 (patch)
treee73773660d78477f0edef96171a29e47eedf81a1 /sbin/newfs
parentbb62736aca381c6f41b59628e6386548d7b3792c (diff)
downloadFreeBSD-src-365714faf01db2ded25f8ecdc958a159aca06437.zip
FreeBSD-src-365714faf01db2ded25f8ecdc958a159aca06437.tar.gz
Use calloc().
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index c8a09b6..b3bbcbf 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -497,11 +497,10 @@ mkfs(struct partition *pp, char *fsys)
iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize;
else
iobufsize = 4 * sblock.fs_bsize;
- if ((iobuf = malloc(iobufsize)) == 0) {
+ if ((iobuf = calloc(1, iobufsize)) == 0) {
printf("Cannot allocate I/O buffer\n");
exit(38);
}
- bzero(iobuf, iobufsize);
/*
* Make a copy of the superblock into the buffer that we will be
* writing out in each cylinder group.
OpenPOWER on IntegriCloud