diff options
author | 2015-01-19 20:47:03 +0000 | |
---|---|---|
committer | 2015-01-19 20:47:03 +0000 | |
commit | 25018bd4229fb49ef5261e8d4380736f781a7664 (patch) | |
tree | 48d4258445cdaa57db0d504736b130af1f88462a | |
parent | finally enable the KEX tests I wrote some years ago... (diff) | |
download | wireguard-openbsd-25018bd4229fb49ef5261e8d4380736f781a7664.tar.xz wireguard-openbsd-25018bd4229fb49ef5261e8d4380736f781a7664.zip |
Use initial assignment of action to check for errors.
This simplifies things and make action = -1 no longer a dead store.
Also, spell FALLTHROUGH consistently.
reported by fritjof@alokat.org
-rw-r--r-- | usr.sbin/ntpd/client.c | 4 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c index 0d984a3def0..06c41fda259 100644 --- a/usr.sbin/ntpd/client.c +++ b/usr.sbin/ntpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.97 2015/01/09 23:44:07 bcook Exp $ */ +/* $OpenBSD: client.c,v 1.98 2015/01/19 20:47:03 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -85,7 +85,7 @@ client_addr_init(struct ntp_peer *p) break; default: fatalx("king bula sez: wrong AF in client_addr_init"); - /* not reached */ + /* NOTREACHED */ } } diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 9796c34133e..6f85b14266d 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.86 2015/01/14 21:14:27 naddy Exp $ */ +/* $OpenBSD: ntpd.c,v 1.87 2015/01/19 20:47:03 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -578,12 +578,11 @@ ctl_main(int argc, char *argv[]) case 'a': action = CTL_SHOW_ALL; break; - default: - usage(); - /* NOTREACHED */ } - } else + } + if (action == -1) usage(); + /* NOTREACHED */ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "ntpctl: socket"); |