summaryrefslogtreecommitdiffstats
path: root/usr.bin/arch/arch.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-09-25 16:19:26 +0000
committertedu <tedu@openbsd.org>2015-09-25 16:19:26 +0000
commit2a81e7f9794ad148e56c712f6faa838e534b0893 (patch)
treeb0e5c0366fd7f5b5dc931460c21cb99809e66933 /usr.bin/arch/arch.c
parentxmalloc/free wrappers don't need to support 20 year old non comformance (diff)
downloadwireguard-openbsd-2a81e7f9794ad148e56c712f6faa838e534b0893.tar.xz
wireguard-openbsd-2a81e7f9794ad148e56c712f6faa838e534b0893.zip
tidy up a bit more
Diffstat (limited to 'usr.bin/arch/arch.c')
-rw-r--r--usr.bin/arch/arch.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/arch/arch.c b/usr.bin/arch/arch.c
index d4e90eb85d5..e5ae829ba72 100644
--- a/usr.bin/arch/arch.c
+++ b/usr.bin/arch/arch.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <unistd.h>
-static void usage(void);
+static void __dead usage(void);
static int machine;
@@ -53,7 +53,7 @@ main(int argc, char *argv[])
arch = MACHINE_ARCH;
opts = "ks";
}
- while ((c = getopt(argc, argv, opts)) != -1)
+ while ((c = getopt(argc, argv, opts)) != -1) {
switch (c) {
case 'a':
arch = MACHINE_ARCH;
@@ -66,19 +66,16 @@ main(int argc, char *argv[])
break;
default:
usage();
- /* NOTREACHED */
}
- if (optind != argc) {
- usage();
- /* NOTREACHED */
}
- if (!short_form)
- fputs("OpenBSD.", stdout);
- puts(arch);
- return 0;
+ if (optind != argc)
+ usage();
+
+ printf("%s%s\n", short_form ? "" : "OpenBSD.", arch);
+ return (0);
}
-static void
+static void __dead
usage(void)
{
if (machine)