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/main.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/main.c')
-rw-r--r-- | usr.bin/netstat/main.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index fb05caa..dea574c 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -133,7 +133,7 @@ struct nlist nl[] = { { "_spx_istat"}, #define N_IPXERR 34 { "_ipx_errstat"}, - "", + { "" }, }; struct protox { @@ -226,9 +226,8 @@ main(argc, argv) int ch; char *nlistf = NULL, *memf = NULL; char buf[_POSIX2_LINE_MAX]; - char buf2[_POSIX2_LINE_MAX]; - if (cp = rindex(argv[0], '/')) + if ((cp = rindex(argv[0], '/'))) prog = cp + 1; else prog = argv[0]; @@ -419,7 +418,7 @@ main(argc, argv) setprotoent(1); setservent(1); /* ugh, this is O(MN) ... why do we do this? */ - while (p = getprotoent()) { + while ((p = getprotoent())) { for (tp = protox; tp->pr_name; tp++) if (strcmp(tp->pr_name, p->p_name) == 0) break; @@ -533,11 +532,11 @@ name2protox(name) * Try to find the name in the list of "well-known" names. If that * fails, check if name is an alias for an Internet protocol. */ - if (tp = knownname(name)) + if ((tp = knownname(name))) return (tp); setprotoent(1); /* make protocol lookup cheaper */ - while (p = getprotoent()) { + while ((p = getprotoent())) { /* assert: name not same as p->name */ for (alias = p->p_aliases; *alias; alias++) if (strcmp(name, *alias) == 0) { |