From: Paul Mackerras Date: Tue, 2 May 1995 05:51:22 +0000 (+0000) Subject: Display recent compression rate as a number between 0 and 1 X-Git-Tag: RELEASE_2_3_6~719 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=af605edb83c683e8edea02892d9d8ec2443f12f8;hp=7efc9a473eebbacad3e4f49f7762b2f013b09e2b Display recent compression rate as a number between 0 and 1 --- diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c index 270ca65..89922de 100644 --- a/pppstats/pppstats.c +++ b/pppstats/pppstats.c @@ -36,7 +36,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: pppstats.c,v 1.7 1995/05/02 04:18:40 paulus Exp $"; +static char rcsid[] = "$Id: pppstats.c,v 1.8 1995/05/02 05:51:22 paulus Exp $"; #endif #include @@ -218,7 +218,7 @@ intpr() W(d.comp_packets), W(d.inc_bytes), W(d.inc_packets), - W(d.ratio) / 256.0); + W(d.ratio) == 0? 0.0: 1 - 1.0 / W(d.ratio) * 256.0); printf(" | %6d %6d %6d %6d %6d %6d %6.2f", W(c.unc_bytes), @@ -227,7 +227,7 @@ intpr() W(c.comp_packets), W(c.inc_bytes), W(c.inc_packets), - W(c.ratio) / 256.0); + W(d.ratio) == 0? 0.0: 1 - 1.0 / W(d.ratio) * 256.0); putchar('\n'); } else {