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@
OpenBSD-Commit-ID:
b2f89346538ce4f5b33ab8011a23e0626a67e66e
-/* $OpenBSD: ssh-keygen.c,v 1.460 2022/11/07 04:04:40 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.461 2022/12/04 23:50:49 cheloha Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
else
fatal("Unsupported moduli option %s", optarg);
break;
- case '?':
default:
usage();
}
-/* $OpenBSD: ssh-keyscan.c,v 1.147 2022/10/28 02:29:34 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.148 2022/12/04 23:50:49 cheloha Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
case '6':
IPv4or6 = AF_INET6;
break;
- case '?':
default:
usage();
}
-/* $OpenBSD: sshd.c,v 1.592 2022/10/28 00:44:17 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.593 2022/12/04 23:50:49 cheloha Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
exit(1);
free(line);
break;
- case '?':
default:
usage();
break;