diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-08-30 12:10:11 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-08-30 12:10:11 +0000 |
commit | b325caf23c9927b68d811503832f0ecd8a82736c (patch) | |
tree | 0de34722713bae889b6f1d4c8177e26d6eb25fe9 | |
parent | c3d95ceb64fce3753f9d8fdfe370f10659cf3501 (diff) |
usage() is __dead.
While here remove one useless call to usage() that's covered by the
very next line.
-rw-r--r-- | sbin/ping/ping.c | 6 | ||||
-rw-r--r-- | sbin/ping6/ping6.c | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index b897c6b7dc6..80b76398e38 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.139 2016/03/03 18:30:48 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.140 2016/08/30 12:10:10 florian Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -183,7 +183,7 @@ void pr_iph(struct ip *); #ifndef SMALL int map_tos(char *, int *); #endif /* SMALL */ -void usage(void); +__dead void usage(void); int main(int argc, char *argv[]) @@ -1445,7 +1445,7 @@ map_tos(char *key, int *val) } #endif /* SMALL */ -void +__dead void usage(void) { (void)fprintf(stderr, diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 4f5b5edb155..f8681350cac 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping6.c,v 1.147 2016/08/30 11:15:16 florian Exp $ */ +/* $OpenBSD: ping6.c,v 1.148 2016/08/30 12:10:10 florian Exp $ */ /* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */ /* @@ -214,7 +214,7 @@ void pr_ip6opt(void *); void pr_rthdr(void *); void pr_retip(struct ip6_hdr *, u_char *); void summary(int); -void usage(void); +__dead void usage(void); int main(int argc, char *argv[]) @@ -355,18 +355,12 @@ main(int argc, char *argv[]) break; default: usage(); - /*NOTREACHED*/ } } argc -= optind; argv += optind; - if (argc < 1) { - usage(); - /*NOTREACHED*/ - } - if (argc != 1) usage(); @@ -1564,7 +1558,7 @@ fill(char *bp, char *patp) } } -void +__dead void usage(void) { (void)fprintf(stderr, |