diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-05-16 22:25:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-05-16 22:25:35 +0000 |
commit | a35958d4ad20dff88ac0db6f9d73a00fc2d89e14 (patch) | |
tree | b4e254411a7a5e1c9b74d5697c62c2ae90ad3c4b | |
parent | c666f71e3b91285d66260567b0b4c57332e0ff1f (diff) |
netstat: fix error in new -W option handling
-rw-r--r-- | networking/netstat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/netstat.c b/networking/netstat.c index 3ba81cd24..5fb5c386f 100644 --- a/networking/netstat.c +++ b/networking/netstat.c @@ -499,6 +499,7 @@ static void do_info(const char *file, const char *name, void (*proc)(int, const int netstat_main(int argc, char **argv); int netstat_main(int argc, char **argv) { + const char *net_conn_line_header = PRINT_NET_CONN_HEADER; unsigned opt; #if ENABLE_FEATURE_IPV6 smallint inet = 1; @@ -531,6 +532,7 @@ int netstat_main(int argc, char **argv) if (opt & OPT_widedisplay) { // -W net_conn_line = PRINT_NET_CONN_WIDE; + net_conn_line_header = PRINT_NET_CONN_HEADER_WIDE; } opt &= NETSTAT_ALLPROTO; @@ -547,8 +549,7 @@ int netstat_main(int argc, char **argv) printf("(only servers)"); else printf("(w/o servers)"); - printf((opt & OPT_widedisplay) ? PRINT_NET_CONN_HEADER_WIDE : PRINT_NET_CONN_HEADER, - "Local Address", "Foreign Address"); + printf(net_conn_line_header, "Local Address", "Foreign Address"); } if (inet && flags & NETSTAT_TCP) do_info(_PATH_PROCNET_TCP, "AF INET (tcp)", tcp_do_one); |