From 843b92406da0fd27eab77e193c8329e5cbea1fa0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 5 Feb 2019 08:17:25 -0600 Subject: Suppress warnings gcc should not be making (and a comment typo). --- toys/pending/sntp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toys/pending/sntp.c b/toys/pending/sntp.c index 8a061584..97f878fa 100644 --- a/toys/pending/sntp.c +++ b/toys/pending/sntp.c @@ -113,7 +113,7 @@ static long long nanodiff(struct timespec *old, struct timespec *new) void sntp_main(void) { struct timespec tv, tv2; - unsigned long long *pktime = (void *)toybuf, now, then, before; + unsigned long long *pktime = (void *)toybuf, now, then, before = before; long long diff = 0; struct addrinfo *ai; union socksaddr sa; @@ -189,12 +189,12 @@ void sntp_main(void) // Is source address what we expect? xstrncpy(buf, ntop(ai->ai_addr), 128); strike = strcmp(buf, ntop((void *)&sa)); - // Does this reply's orignate timestamp match the packet we sent? + // Does this reply's originate timestamp match the packet we sent? if (!FLAG(S) && !FLAG(m) && before != SWAP_BE64(pktime[3])) continue; // Ignore packets from wrong address or with wrong mode if (strike && !FLAG(S)) continue; - if (!(FLAG(m) && mode==5 || FLAG(S) && mode==3 || - !FLAG(m) && !FLAG(S) && mode==4)) continue; + if (!((FLAG(m) && mode==5) || (FLAG(S) && mode==3) || + (!FLAG(m) && !FLAG(S) && mode==4))) continue; } // If received a -S request packet, send server packet -- cgit v1.2.3