From 57d7cc66ff56f2511c3cf9e089ec2c35e4b122c1 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 10 Sep 1997 08:43:17 +0000 Subject: [PATCH] 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) --- usr.sbin/pppstats/pppstats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/pppstats/pppstats.c b/usr.sbin/pppstats/pppstats.c index b74bbcd5fce..4baab012fce 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 @@ -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 {