summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-11-03 18:13:05 +0000
committersam <sam@FreeBSD.org>2007-11-03 18:13:05 +0000
commitc7b641222ce610b59cad4e950684efafb1fbd15a (patch)
treea288218bd20544e44296a6e6300cea31083f67bf /tools
parent8135d90244869e9f1e26e7cb7c5a410c9e2de87e (diff)
downloadFreeBSD-src-c7b641222ce610b59cad4e950684efafb1fbd15a.zip
FreeBSD-src-c7b641222ce610b59cad4e950684efafb1fbd15a.tar.gz
align stats printed out w/o any args
MFC after: 1 week
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/net80211/wlanstats/statfoo.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/tools/net80211/wlanstats/statfoo.c b/tools/tools/net80211/wlanstats/statfoo.c
index 99c616b..7719036 100644
--- a/tools/tools/net80211/wlanstats/statfoo.c
+++ b/tools/tools/net80211/wlanstats/statfoo.c
@@ -144,12 +144,20 @@ statfoo_print_total(struct statfoo *sf, FILE *fd)
static void
statfoo_print_verbose(struct statfoo *sf, FILE *fd)
{
+ const struct fmt *f;
char s[32];
- int i;
+ int i, width;
+ width = 0;
+ for (i = 0; i < sf->nstats; i++) {
+ f = &sf->stats[i];
+ if (f->width > width)
+ width = f->width;
+ }
for (i = 0; i < sf->nstats; i++) {
+ f = &sf->stats[i];
if (sf->get_totstat(sf, i, s, sizeof(s)) && strcmp(s, "0"))
- fprintf(fd, "%s %s\n", s, sf->stats[i].desc);
+ fprintf(fd, "%-*s %s\n", width, s, f->desc);
}
}
OpenPOWER on IntegriCloud