diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-12-04 23:50:52 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-12-04 23:50:52 +0000 |
commit | 7119931719c16b3e14f3ca5213b351e777080528 (patch) | |
tree | db01a02e50effc999803525fd4173a9bc9a2646f /usr.sbin/fdformat/fdformat.c | |
parent | 45b7e652cd98369e756e28db16f4aad0626aec0d (diff) |
userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument. We can
handle this case with the "default" failure case with no loss of
legibility. Hence, remove all the redundant "case '?':" lines.
Prompted by dlg@. With help from dlg@ and millert@.
Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
Diffstat (limited to 'usr.sbin/fdformat/fdformat.c')
-rw-r--r-- | usr.sbin/fdformat/fdformat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c index 2b1603c3779..556e68528f2 100644 --- a/usr.sbin/fdformat/fdformat.c +++ b/usr.sbin/fdformat/fdformat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdformat.c,v 1.24 2019/06/28 13:32:47 deraadt Exp $ */ +/* $OpenBSD: fdformat.c,v 1.25 2022/12/04 23:50:50 cheloha Exp $ */ /* * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden @@ -236,7 +236,7 @@ main(int argc, char *argv[]) verify_only = 1; break; - case '?': default: + default: usage(); } |