diff options
| author | Rob Landley <rob@landley.net> | 2018-06-14 12:14:52 -0500 | 
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2018-06-14 12:14:52 -0500 | 
| commit | 5605a0ff2ad28eafa3ce6f2f4ef1ca96498ab79d (patch) | |
| tree | cfb6ded0beb7af750a89587d662269331aa52faf | |
| parent | 442f7a0c90b537c1af56c6ce7b3f40a0a47f822d (diff) | |
| download | toybox-5605a0ff2ad28eafa3ce6f2f4ef1ca96498ab79d.tar.gz | |
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).
| -rw-r--r-- | toys/net/ping.c | 2 | 
1 files changed, 1 insertions, 1 deletions
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;  | 
