summaryrefslogtreecommitdiff
path: root/sbin/fsck_ext2fs
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:02:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:02:22 +0000
commit999d668af49ba65ca209316fb879a8459e9f850e (patch)
treec9473babdf7ff29e941f183a4a1929fba6c63699 /sbin/fsck_ext2fs
parent9e6263b04dc3a7a8ef2f02175efe20fe4ab2097a (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')
-rw-r--r--sbin/fsck_ext2fs/pass1.c6
-rw-r--r--sbin/fsck_ext2fs/setup.c10
-rw-r--r--sbin/fsck_ext2fs/utilities.c4
3 files changed, 9 insertions, 11 deletions
diff --git a/sbin/fsck_ext2fs/pass1.c b/sbin/fsck_ext2fs/pass1.c
index 608d45e3f37..020da5f0f1f 100644
--- a/sbin/fsck_ext2fs/pass1.c
+++ b/sbin/fsck_ext2fs/pass1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1.c,v 1.15 2015/01/16 06:39:57 deraadt Exp $ */
+/* $OpenBSD: pass1.c,v 1.16 2015/08/20 22:02:20 deraadt Exp $ */
/* $NetBSD: pass1.c,v 1.9 2000/01/31 11:40:12 bouyer Exp $ */
/*
@@ -239,7 +239,7 @@ checkinode(ino_t inumber, struct inodesc *idesc)
n_files++;
lncntp[inumber] = letoh16(dp->e2di_nlink);
if (dp->e2di_nlink == 0) {
- zlnp = (struct zlncnt *)malloc(sizeof *zlnp);
+ zlnp = malloc(sizeof *zlnp);
if (zlnp == NULL) {
pfatal("LINK COUNT TABLE OVERFLOW");
if (reply("CONTINUE") == 0)
@@ -326,7 +326,7 @@ pass1check(struct inodesc *idesc)
errexit("%s\n", "");
return (STOP);
}
- new = (struct dups *)malloc(sizeof(struct dups));
+ new = malloc(sizeof(struct dups));
if (new == NULL) {
pfatal("DUP TABLE OVERFLOW.");
if (reply("CONTINUE") == 0)
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 *)));
diff --git a/sbin/fsck_ext2fs/utilities.c b/sbin/fsck_ext2fs/utilities.c
index 3eb2daa4753..89b6c4d4f6a 100644
--- a/sbin/fsck_ext2fs/utilities.c
+++ b/sbin/fsck_ext2fs/utilities.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utilities.c,v 1.24 2015/01/16 06:39:57 deraadt Exp $ */
+/* $OpenBSD: utilities.c,v 1.25 2015/08/20 22:02:20 deraadt Exp $ */
/* $NetBSD: utilities.c,v 1.6 2001/02/04 21:19:34 christos Exp $ */
/*
@@ -127,7 +127,7 @@ bufinit(void)
if (bufcnt < MINBUFS)
bufcnt = MINBUFS;
for (i = 0; i < bufcnt; i++) {
- bp = (struct bufarea *)malloc(sizeof(struct bufarea));
+ bp = malloc(sizeof(struct bufarea));
bufp = malloc((unsigned int)sblock.e2fs_bsize);
if (bp == NULL || bufp == NULL) {
free(bp);