diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2017-07-08 16:22:30 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2017-07-08 16:22:30 +0000 |
commit | 96c52f53f1b5314a1dfe3d71e1a08e9d5c9ef003 (patch) | |
tree | 6eda98331c3adbd75dc902147906673b9bc58025 /sbin/ping | |
parent | d3c2b4a33f2d2eb520ea17b4c1e02467293387bc (diff) |
Consistently use if ((option & F_FOO) && (option & F_BAR)) instead of
if (option & F_FOO && option & F_BAR).
Prompted by a reverse diff from Klemens Nanni. Both forms are
equivalent due to operator precedence, I consider the later to be
easier on the eyes.
Diffstat (limited to 'sbin/ping')
-rw-r--r-- | sbin/ping/ping.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index a837a77237f..5f21e7919c3 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.222 2017/07/08 16:21:51 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.223 2017/07/08 16:22:29 florian Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -573,7 +573,7 @@ main(int argc, char *argv[]) if (v6flag) { /* in F_VERBOSE case, we may get non-echoreply packets*/ - if (options & F_VERBOSE && datalen < 2048) /* XXX 2048? */ + if ((options & F_VERBOSE) && datalen < 2048) /* XXX 2048? */ packlen = 2048 + IP6LEN + ECHOLEN + EXTRA; else packlen = datalen + IP6LEN + ECHOLEN + EXTRA; @@ -696,7 +696,7 @@ main(int argc, char *argv[]) options |= F_HDRINCL; } - if (options & F_RROUTE && options & F_HDRINCL) + if ((options & F_RROUTE) && (options & F_HDRINCL)) errx(1, "-R option and -D or -T, or -t to unicast" " destinations are incompatible"); @@ -1092,7 +1092,7 @@ pinger(int s) warn("sendmsg"); printf("ping: wrote %s %d chars, ret=%d\n", hostname, cc, i); } - if (!(options & F_QUIET) && options & F_FLOOD) + if (!(options & F_QUIET) && (options & F_FLOOD)) write(STDOUT_FILENO, &DOT, 1); return (0); |