diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:02:22 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:02:22 +0000 |
commit | 999d668af49ba65ca209316fb879a8459e9f850e (patch) | |
tree | c9473babdf7ff29e941f183a4a1929fba6c63699 /sbin/fsck_ext2fs/setup.c | |
parent | 9e6263b04dc3a7a8ef2f02175efe20fe4ab2097a (diff) |
<stdlib.h> is included, so do not need to cast result from
malloc, calloc, realloc*
ok krw millert
Diffstat (limited to 'sbin/fsck_ext2fs/setup.c')
-rw-r--r-- | sbin/fsck_ext2fs/setup.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c index 7f2404f5f28..32d7e62ef63 100644 --- a/sbin/fsck_ext2fs/setup.c +++ b/sbin/fsck_ext2fs/setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setup.c,v 1.25 2015/01/16 06:39:57 deraadt Exp $ */ +/* $OpenBSD: setup.c,v 1.26 2015/08/20 22:02:20 deraadt Exp $ */ /* $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */ /* @@ -218,7 +218,7 @@ setup(char *dev) (unsigned)(maxino + 1)); goto badsblabel; } - lncntp = (int16_t *)calloc((unsigned)(maxino + 1), sizeof(int16_t)); + lncntp = calloc((unsigned)(maxino + 1), sizeof(int16_t)); if (lncntp == NULL) { printf("cannot alloc %u bytes for lncntp\n", (unsigned)((maxino + 1) * sizeof(int16_t))); @@ -229,10 +229,8 @@ setup(char *dev) } inplast = 0; listmax = numdirs + 10; - inpsort = (struct inoinfo **)calloc((unsigned)listmax, - sizeof(struct inoinfo *)); - inphead = (struct inoinfo **)calloc((unsigned)numdirs, - sizeof(struct inoinfo *)); + inpsort = calloc((unsigned)listmax, sizeof(struct inoinfo *)); + inphead = calloc((unsigned)numdirs, sizeof(struct inoinfo *)); if (inpsort == NULL || inphead == NULL) { printf("cannot alloc %u bytes for inphead\n", (unsigned)(numdirs * sizeof(struct inoinfo *))); |