From 5605a0ff2ad28eafa3ce6f2f4ef1ca96498ab79d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 14 Jun 2018 12:14:52 -0500 Subject: I tend to put extra parentheses around & because its precedence being slightly wonky was Dennis Ritche's one public regret about C (see https://www.lysator.liu.se/c/dmr-on-or.html). --- toys/net/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/net') diff --git a/toys/net/ping.c b/toys/net/ping.c index c329949d..86384794 100644 --- a/toys/net/ping.c +++ b/toys/net/ping.c @@ -126,7 +126,7 @@ void ping_main(void) if ((toys.optflags&(FLAG_f|FLAG_c)) == FLAG_f) TT.c = 15; // ipv4 or ipv6? (0 = autodetect if -I or arg have only one address type.) - if (toys.optflags&FLAG_6 || toys.which->name[4] == '6') family = AF_INET6; + if ((toys.optflags&FLAG_6) || toys.which->name[4] == '6') family = AF_INET6; else if (toys.optflags&FLAG_4) family = AF_INET; else family = 0; -- cgit v1.2.3