diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-13 00:29:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-13 00:29:26 +0000 |
commit | c5d6629ca442f8c81679e5e30f6bad20f80c98fc (patch) | |
tree | 74af545b11ce8cbd910aed5728954f347e825335 /sbin | |
parent | 9efd8c9a51f32614812274337015b8578627f331 (diff) |
Remove obsolete flags (h, v, i, c) from getopt() call.
No need for 'flags' variable. Just call usage() on unknown options.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pdisk/pdisk.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index 355d6a6db14..da16012f06c 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.28 2016/01/12 20:22:32 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.29 2016/01/13 00:29:25 krw Exp $ */ // // pdisk - an editor for Apple format partition tables @@ -162,7 +162,6 @@ get_options(int argc, char **argv) int c; extern int optind; extern char *optarg; - int flag = 0; lflag = LFLAG_DEFAULT; lfile = NULL; @@ -172,7 +171,7 @@ get_options(int argc, char **argv) pflag = PFLAG_DEFAULT; optind = 1; // reset option scanner logic - while ((c = getopt(argc, argv, "hlvdric")) != -1) { + while ((c = getopt(argc, argv, "ldr")) != -1) { switch (c) { case 'l': lflag = (LFLAG_DEFAULT)?0:1; @@ -190,13 +189,11 @@ get_options(int argc, char **argv) pflag = (PFLAG_DEFAULT)?0:1; break; default: - flag = 1; + usage(); break; } } - if (flag) { - usage(); - } + return optind; } |