From 8a1dff0c7318e6ed89db2ee4450167e7c487025d Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Sun, 29 May 2005 16:07:10 +0000 Subject: [PATCH] Give variable an initial value. Use errx() instead of fprintf(). --- sbin/clri/clri.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c index d5a358d33d6..dc77a41c66d 100644 --- a/sbin/clri/clri.c +++ b/sbin/clri/clri.c @@ -41,6 +41,7 @@ static const char copyright[] = static char sccsid[] = "@(#)clri.c 8.2 (Berkeley) 9/23/93"; #endif /* not lint */ #endif + #include __FBSDID("$FreeBSD$"); @@ -85,6 +86,7 @@ main(int argc, char *argv[]) usage(); fs = *++argv; + sbp = NULL; /* get the superblock. */ if ((fd = open(fs, O_RDWR, 0)) < 0) @@ -102,10 +104,8 @@ main(int argc, char *argv[]) sbp->fs_bsize >= (int)sizeof(struct fs)) break; } - if (sblock_try[i] == -1) { - fprintf(stderr, "Cannot find file system superblock\n"); - exit(2); - } + if (sblock_try[i] == -1) + errx(2, "cannot find file system superblock"); bsize = sbp->fs_bsize; /* remaining arguments are inode numbers. */