Author: asomers
Date: Thu Aug 15 16:09:27 2019
New Revision: 351082
URL: https://svnweb.freebsd.org/changeset/base/351082

Log:
  ping6: fix uninitialized variable warning for intvl
  
  GCC isn't smart enough to realize that this variable was always initialized.
  
  Submitted by: Ján Sučan <sucan...@gmail.com>
  MFC after:    2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:        https://reviews.freebsd.org/D21271

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==============================================================================
--- head/sbin/ping6/ping6.c     Thu Aug 15 16:04:22 2019        (r351081)
+++ head/sbin/ping6/ping6.c     Thu Aug 15 16:09:27 2019        (r351082)
@@ -333,6 +333,9 @@ main(int argc, char *argv[])
        memset(&smsghdr, 0, sizeof(smsghdr));
        memset(&smsgiov, 0, sizeof(smsgiov));
 
+       intvl.tv_sec = interval / 1000;
+       intvl.tv_nsec = interval % 1000 * 1000000;
+
        alarmtimeout = preload = 0;
        datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN];
        capdns = capdns_setup();
@@ -1121,9 +1124,6 @@ main(int argc, char *argv[])
        if (options & F_FLOOD) {
                intvl.tv_sec = 0;
                intvl.tv_nsec = 10000000;
-       } else if ((options & F_INTERVAL) == 0) {
-               intvl.tv_sec = interval / 1000;
-               intvl.tv_nsec = interval % 1000 * 1000000;
        }
 
        almost_done = 0;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to