summaryrefslogtreecommitdiffstats
path: root/sbin/ping6
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2003-07-21 11:06:47 +0000
committermaxim <maxim@FreeBSD.org>2003-07-21 11:06:47 +0000
commit68415c8fc274a99c4e5704a73074d4f12f834a92 (patch)
tree69f3b9ce3cea400acb585a1d35bac47fcc10b426 /sbin/ping6
parent0904d6e85b2dd028e5d2ee3184b9605d3f59963a (diff)
downloadFreeBSD-src-68415c8fc274a99c4e5704a73074d4f12f834a92.zip
FreeBSD-src-68415c8fc274a99c4e5704a73074d4f12f834a92.tar.gz
Quote from a Problem Report:
The output format specifier for the round-trip time in ping6 should be changed to %.3f instead of %g since %g doesn't accurately represent the precision of the number being output. In particular, %g truncates trailing zeroes. 0.01 ms does not mean the same thing as 0.010 ms. Although they are numerically identical, they do not have the same precision. PR: bin/52324, bin/52750 Submitted by: dg MFC after: 1 week
Diffstat (limited to 'sbin/ping6')
-rw-r--r--sbin/ping6/ping6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index 9f43a23..c8f3ba8 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1474,7 +1474,7 @@ pr_pack(buf, cc, mhdr)
sizeof(dstsa)));
}
if (timing)
- (void)printf(" time=%g ms", triptime);
+ (void)printf(" time=%.3f ms", triptime);
if (dupflag)
(void)printf("(DUP!)");
/* check the data */
OpenPOWER on IntegriCloud