diff options
author | gavin <gavin@FreeBSD.org> | 2010-06-19 17:04:01 +0000 |
---|---|---|
committer | gavin <gavin@FreeBSD.org> | 2010-06-19 17:04:01 +0000 |
commit | 7c153097dda79f0fd09a34cdce819db883afa017 (patch) | |
tree | 3be7b4ba3b43d1236c27865787b02dc45cdd67b0 /usr.sbin/timed | |
parent | 11f1a56c140aeed5f46361ef32a76d51924f3f70 (diff) | |
download | FreeBSD-src-7c153097dda79f0fd09a34cdce819db883afa017.zip FreeBSD-src-7c153097dda79f0fd09a34cdce819db883afa017.tar.gz |
Initialise the "trials" variable to zero earlier in case we unexpectedly
error out early.
Found by: clang static analyzer
Diffstat (limited to 'usr.sbin/timed')
-rw-r--r-- | usr.sbin/timed/timed/measure.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/timed/timed/measure.c b/usr.sbin/timed/timed/measure.c index 3856a34..05fb119 100644 --- a/usr.sbin/timed/timed/measure.c +++ b/usr.sbin/timed/timed/measure.c @@ -86,6 +86,7 @@ measure(maxmsec, wmsec, hname, addr, print) min_idelta = min_odelta = 0x7fffffff; measure_status = HOSTDOWN; measure_delta = HOSTDOWN; + trials = 0; errno = 0; /* open raw socket used to measure time differences */ @@ -138,7 +139,6 @@ measure(maxmsec, wmsec, hname, addr, print) mstotvround(&twait, wmsec); rcvcount = 0; - trials = 0; while (rcvcount < MSGS) { (void)gettimeofday(&tcur, 0); |