From af605edb83c683e8edea02892d9d8ec2443f12f8 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 2 May 1995 05:51:22 +0000 Subject: [PATCH] Display recent compression rate as a number between 0 and 1 --- pppstats/pppstats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { -- 2.39.2