aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2001-10-19 09:28:01 +0000
committerAndi Kleen <andi@firstfloor.org>2001-10-19 09:28:01 +0000
commitd67a12a50350c1686df85c693b498f86000226dd (patch)
tree989b3b5707512462e77d23f3ff666010039368d4 /statistics.c
parentFix netstat -- don't print all v4 addresses as v4-mapped-in-v6. (diff)
downloadnet-tools-d67a12a50350c1686df85c693b498f86000226dd.tar.gz
net-tools-d67a12a50350c1686df85c693b498f86000226dd.tar.bz2
net-tools-d67a12a50350c1686df85c693b498f86000226dd.zip
Only print unknown statistics when their counter is > 0.
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/statistics.c b/statistics.c
index a878df8..4f76dc3 100644
--- a/statistics.c
+++ b/statistics.c
@@ -1,6 +1,6 @@
/*
* Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL.
- * $Id: statistics.c,v 1.14 2001/02/02 18:01:23 pb Exp $
+ * $Id: statistics.c,v 1.15 2001/10/19 09:28:01 ak Exp $
* 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels
@@ -222,7 +222,8 @@ void printval(struct tabtab *tab, char *title, int val)
ent = bsearch(&key, tab->tab, tab->size / sizeof(struct entry),
sizeof(struct entry), cmpentries);
if (!ent) { /* try our best */
- printf("%*s%s: %d\n", states[state].indent, "", title, val);
+ if (val)
+ printf("%*s%s: %d\n", states[state].indent, "", title, val);
return;
}
type = ent->type;