Use calloc().
This commit is contained in:
parent
bf10880210
commit
a6a568708b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176851
@ -497,11 +497,10 @@ mkfs(struct partition *pp, char *fsys)
|
|||||||
iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize;
|
iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize;
|
||||||
else
|
else
|
||||||
iobufsize = 4 * sblock.fs_bsize;
|
iobufsize = 4 * sblock.fs_bsize;
|
||||||
if ((iobuf = malloc(iobufsize)) == 0) {
|
if ((iobuf = calloc(1, iobufsize)) == 0) {
|
||||||
printf("Cannot allocate I/O buffer\n");
|
printf("Cannot allocate I/O buffer\n");
|
||||||
exit(38);
|
exit(38);
|
||||||
}
|
}
|
||||||
bzero(iobuf, iobufsize);
|
|
||||||
/*
|
/*
|
||||||
* Make a copy of the superblock into the buffer that we will be
|
* Make a copy of the superblock into the buffer that we will be
|
||||||
* writing out in each cylinder group.
|
* writing out in each cylinder group.
|
||||||
|
Loading…
Reference in New Issue
Block a user