diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-13 22:27:36 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-13 22:27:36 +0000 |
commit | 3f825d7ad05bf25ce8dd127bca6b4ed3af8bb0d9 (patch) | |
tree | 042f0d8f8c9d01e425f5ccb4544082ed42cbaf2c | |
parent | deab02c74a53f59d146824c0c4f7270b81c54bcc (diff) |
No need to supplement usage() with extra messages about -b needing -i, or
-g needing -i. The usage() text is quite clear.
usage() doesn't return so eliminate unneeded 'else'.
-rw-r--r-- | sbin/fdisk/fdisk.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index d9ec83771f0..21ace844aa3 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdisk.c,v 1.83 2015/11/13 21:54:10 krw Exp $ */ +/* $OpenBSD: fdisk.c,v 1.84 2015/11/13 22:27:35 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -142,23 +142,13 @@ main(int argc, char *argv[]) argv += optind; /* Argument checking */ - if (argc != 1 || (i_flag && u_flag)) + if (argc != 1 || (i_flag && u_flag) || + (i_flag == 0 && (b_arg || g_flag))) usage(); - else - disk.name = argv[0]; + disk.name = argv[0]; DISK_open(); - if (b_arg > 0 && i_flag == 0) { - warnx("-b specified without -i"); - usage(); - } - - if (g_flag != 0 && i_flag == 0) { - warnx("-g specified without -i"); - usage(); - } - /* Get the GPT if present. */ if (GPT_get_gpt()) { memset(&gh, 0, sizeof(gh)); |