summaryrefslogtreecommitdiff
path: root/usr.sbin/pppd/pppstats/pppstats.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
commit882e83ccf31fca22178b290a6753a605bb52044c (patch)
treee2e6ec6ef7e162fd03a03e5c71bc96ce90d1c105 /usr.sbin/pppd/pppstats/pppstats.c
parent67d88b0a9910a68bb666b448d2dac29cb4d3d8c2 (diff)
sync to netbsd 960418
Diffstat (limited to 'usr.sbin/pppd/pppstats/pppstats.c')
-rw-r--r--usr.sbin/pppd/pppstats/pppstats.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pppd/pppstats/pppstats.c b/usr.sbin/pppd/pppstats/pppstats.c
index fc6a541bcc8..21c79f4d2a0 100644
--- a/usr.sbin/pppd/pppstats/pppstats.c
+++ b/usr.sbin/pppd/pppstats/pppstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppstats.c,v 1.2 1996/03/25 15:56:05 niklas Exp $ */
+/* $OpenBSD: pppstats.c,v 1.3 1996/04/21 23:41:32 deraadt Exp $ */
/*
* print PPP statistics:
@@ -30,7 +30,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: pppstats.c,v 1.2 1996/03/25 15:56:05 niklas Exp $";
+static char rcsid[] = "$OpenBSD: pppstats.c,v 1.3 1996/04/21 23:41:32 deraadt Exp $";
#endif
#include <stdio.h>
@@ -118,9 +118,9 @@ get_ppp_cstats(csp)
err(1, "couldn't get PPP compression stats");
}
-
-#define V(offset) (cur.offset - old.offset)
-#define W(offset) (ccs.offset - ocs.offset)
+#define MAX0(a) ((int)(a) > 0? (a): 0)
+#define V(offset) MAX0(cur.offset - old.offset)
+#define W(offset) MAX0(ccs.offset - ocs.offset)
#define RATIO(c, i, u) ((c) == 0? 1.0: (u) / ((double)(c) + (i)))
#define CRATE(x) RATIO(W(x.comp_bytes), W(x.inc_bytes), W(x.unc_bytes))