diff options
author | peter <peter@FreeBSD.org> | 1997-09-10 08:43:17 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-09-10 08:43:17 +0000 |
commit | e032db2bc7b4ab1b82b16325d8994e5fefc49e94 (patch) | |
tree | ced9842e59479c21e59ce7ecf9e29b64fef13de8 /usr.sbin | |
parent | bd79753a5b9b2c9b8e4911ea1f0a3f9bf3ca17e0 (diff) | |
download | FreeBSD-src-e032db2bc7b4ab1b82b16325d8994e5fefc49e94.zip FreeBSD-src-e032db2bc7b4ab1b82b16325d8994e5fefc49e94.tar.gz |
Duh, calculate the compression ration correctly. (fixed point artithmatic
with 8 "fractional" bits needs to be divided (not multiplied) by 256.0
to get a floating point representation)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pppstats/pppstats.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pppstats/pppstats.c b/usr.sbin/pppstats/pppstats.c index b74bbcd..4baab01 100644 --- a/usr.sbin/pppstats/pppstats.c +++ b/usr.sbin/pppstats/pppstats.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: pppstats.c,v 1.9 1997/02/22 16:12:12 peter Exp $"; +static char rcsid[] = "$Id: pppstats.c,v 1.10 1997/08/22 15:39:04 peter Exp $"; #endif #include <stdio.h> @@ -310,26 +310,26 @@ intpr() W(d.comp_packets), KBPS(W(d.inc_bytes)), W(d.inc_packets), - ccs.d.ratio * 256.0); + ccs.d.ratio / 256.0); printf(" | %8.3f %6u %8.3f %6u %6.2f", KBPS(W(c.comp_bytes)), W(c.comp_packets), KBPS(W(c.inc_bytes)), W(c.inc_packets), - ccs.c.ratio * 256.0); + ccs.c.ratio / 256.0); } else { printf("%8u %6u %8u %6u %6.2f", W(d.comp_bytes), W(d.comp_packets), W(d.inc_bytes), W(d.inc_packets), - ccs.d.ratio * 256.0); + ccs.d.ratio / 256.0); printf(" | %8u %6u %8u %6u %6.2f", W(c.comp_bytes), W(c.comp_packets), W(c.inc_bytes), W(c.inc_packets), - ccs.c.ratio * 256.0); + ccs.c.ratio / 256.0); } } else { |