diff options
author | alex <alex@FreeBSD.org> | 1996-06-02 23:19:12 +0000 |
---|---|---|
committer | alex <alex@FreeBSD.org> | 1996-06-02 23:19:12 +0000 |
commit | 5c1e86ebb424294fcfae39ae7ff1efcf8808086d (patch) | |
tree | a562c2f6b0b887d7adcf7d867066326bca326e2e /usr.bin/netstat/if.c | |
parent | 256d4f51af66d46915508a783071de1a6b139187 (diff) | |
download | FreeBSD-src-5c1e86ebb424294fcfae39ae7ff1efcf8808086d.zip FreeBSD-src-5c1e86ebb424294fcfae39ae7ff1efcf8808086d.tar.gz |
Code cleanup: remove unused variables, use correct *printf format
specifiers (some unsigned values were printed as signed, some longs
were printed as ints), and place parentheses around assignments in
if statements.
Diffstat (limited to 'usr.bin/netstat/if.c')
-rw-r--r-- | usr.bin/netstat/if.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index d4cedce..43fd8cb 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -136,7 +136,7 @@ intpr(interval, ifnetaddr) *cp = '\0'; ifaddraddr = (u_long)ifnet.if_addrlist; } - printf("%-5.5s %-5d ", name, ifnet.if_mtu); + printf("%-5.5s %-5lu ", name, ifnet.if_mtu); if (ifaddraddr == 0) { printf("%-13.13s ", "none"); printf("%-15.15s ", "none"); @@ -229,15 +229,15 @@ intpr(interval, ifnetaddr) } ifaddraddr = (u_long)ifaddr.ifa.ifa_next; } - printf("%8d %5d ", + printf("%8lu %5lu ", ifnet.if_ipackets, ifnet.if_ierrors); if (bflag) - printf("%10d ", ifnet.if_ibytes); - printf("%8d %5d ", + printf("%10lu ", ifnet.if_ibytes); + printf("%8lu %5lu ", ifnet.if_opackets, ifnet.if_oerrors); if (bflag) - printf("%10d ", ifnet.if_obytes); - printf("%5d", ifnet.if_collisions); + printf("%10lu ", ifnet.if_obytes); + printf("%5lu", ifnet.if_collisions); if (tflag) printf(" %3d", ifnet.if_timer); if (dflag) @@ -288,7 +288,6 @@ sidewaysintpr(interval, off) interesting = NULL; interesting_off = 0; for (off = firstifnet, ip = iftot; off;) { - char *cp; char name[16], tname[16]; if (kread(off, (char *)&ifnet, sizeof ifnet)) @@ -342,7 +341,7 @@ loop: exit(1); }; if (!first) { - printf("%10u %5u %10u %10u %5u %10u %5u", + printf("%10lu %5lu %10lu %10lu %5lu %10lu %5lu", ifnet.if_ipackets - ip->ift_ip, ifnet.if_ierrors - ip->ift_ie, ifnet.if_ibytes - ip->ift_ib, |