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 <sucanjan@gmail.com>
MFC after:	2 weeks
Sponsored by:	Google, inc. (Google Summer of Code 2019)
Differential Revision:	https://reviews.freebsd.org/D21271
This commit is contained in:
Alan Somers 2019-08-15 16:09:27 +00:00
parent d632f88e20
commit 631b873cd8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351082

View File

@ -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;