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 /networking | |
parent | c666f71e3b91285d66260567b0b4c57332e0ff1f (diff) | |
download | busybox-w32-a35958d4ad20dff88ac0db6f9d73a00fc2d89e14.tar.gz busybox-w32-a35958d4ad20dff88ac0db6f9d73a00fc2d89e14.tar.bz2 busybox-w32-a35958d4ad20dff88ac0db6f9d73a00fc2d89e14.zip |
netstat: fix error in new -W option handling
Diffstat (limited to 'networking')
-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 | |||
499 | int netstat_main(int argc, char **argv); | 499 | int netstat_main(int argc, char **argv); |
500 | int netstat_main(int argc, char **argv) | 500 | int netstat_main(int argc, char **argv) |
501 | { | 501 | { |
502 | const char *net_conn_line_header = PRINT_NET_CONN_HEADER; | ||
502 | unsigned opt; | 503 | unsigned opt; |
503 | #if ENABLE_FEATURE_IPV6 | 504 | #if ENABLE_FEATURE_IPV6 |
504 | smallint inet = 1; | 505 | smallint inet = 1; |
@@ -531,6 +532,7 @@ int netstat_main(int argc, char **argv) | |||
531 | 532 | ||
532 | if (opt & OPT_widedisplay) { // -W | 533 | if (opt & OPT_widedisplay) { // -W |
533 | net_conn_line = PRINT_NET_CONN_WIDE; | 534 | net_conn_line = PRINT_NET_CONN_WIDE; |
535 | net_conn_line_header = PRINT_NET_CONN_HEADER_WIDE; | ||
534 | } | 536 | } |
535 | 537 | ||
536 | opt &= NETSTAT_ALLPROTO; | 538 | opt &= NETSTAT_ALLPROTO; |
@@ -547,8 +549,7 @@ int netstat_main(int argc, char **argv) | |||
547 | printf("(only servers)"); | 549 | printf("(only servers)"); |
548 | else | 550 | else |
549 | printf("(w/o servers)"); | 551 | printf("(w/o servers)"); |
550 | printf((opt & OPT_widedisplay) ? PRINT_NET_CONN_HEADER_WIDE : PRINT_NET_CONN_HEADER, | 552 | printf(net_conn_line_header, "Local Address", "Foreign Address"); |
551 | "Local Address", "Foreign Address"); | ||
552 | } | 553 | } |
553 | if (inet && flags & NETSTAT_TCP) | 554 | if (inet && flags & NETSTAT_TCP) |
554 | do_info(_PATH_PROCNET_TCP, "AF INET (tcp)", tcp_do_one); | 555 | do_info(_PATH_PROCNET_TCP, "AF INET (tcp)", tcp_do_one); |