From 94f138fe6022bf3cb80608ece005ea315cbd081f Mon Sep 17 00:00:00 2001 From: "George V. Neville-Neil" Date: Fri, 28 Nov 2008 18:35:14 +0000 Subject: [PATCH] Fix a printing problem when using the -L flag to netstat caused by adding the -x flag earlier. Submitted by: Anton Yuzhaninov MFC after: 3 days --- usr.bin/netstat/inet.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index bdf23bfca4ee..fd95a8844676 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -407,19 +407,22 @@ protopr(u_long off, const char *name, int af1, int proto) if (Lflag) printf("%-5.5s %-14.14s %-22.22s\n", "Proto", "Listen", "Local Address"); - printf((Aflag && !Wflag) ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", - "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address"); - if (xflag) - printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n", - "R-MBUF", "S-MBUF", "R-CLUS", "S-CLUS", - "R-HIWA", "S-HIWA", "R-LOWA", "S-LOWA", - "R-BCNT", "S-BCNT", "R-BMAX", "S-BMAX", - "(state)"); - else - printf("(state)\n"); + else { + printf((Aflag && !Wflag) ? + "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s" : + "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", + "Proto", "Recv-Q", "Send-Q", + "Local Address", "Foreign Address"); + if (xflag) + printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n", + "R-MBUF", "S-MBUF", "R-CLUS", + "S-CLUS", "R-HIWA", "S-HIWA", + "R-LOWA", "S-LOWA", "R-BCNT", + "S-BCNT", "R-BMAX", "S-BMAX", + "(state)"); + else + printf("(state)\n"); + } first = 0; } if (Lflag && so->so_qlimit == 0)