OSDN Git Service

Fix trailing whitespace bug in netstat.
authorElliott Hughes <enh@google.com>
Fri, 10 Jun 2016 16:08:33 +0000 (09:08 -0700)
committerRob Landley <rob@landley.net>
Fri, 10 Jun 2016 23:54:54 +0000 (18:54 -0500)
Spotted while trying to diff netstat -nt against toybox netstat -nt.

toys/pending/netstat.c

index f8d622e..c77f49f 100644 (file)
@@ -147,9 +147,9 @@ static void display_data(unsigned rport, char *label,
   xprintf("%3s   %6d %6d ", label, rxq, txq);
   xprintf((toys.optflags & FLAG_W) ? "%-51.51s %-51.51s " : "%-23.23s %-23.23s "
            , lip, rip);
-  xprintf("%-11s ", ss_state);
-  if ((toys.optflags & FLAG_e)) xprintf("%-10s %-11ld ", user, inode);
-  if ((toys.optflags & FLAG_p)) xprintf("%s", get_pid_name(inode));
+  xprintf("%-11s", ss_state);
+  if ((toys.optflags & FLAG_e)) xprintf(" %-10s %-11ld", user, inode);
+  if ((toys.optflags & FLAG_p)) xprintf(" %s", get_pid_name(inode));
   xputc('\n');
 }