ss: fix end-of-line printing in misc/ss.c

The previous change to ss to show header broke the printing of
end-of-line for the last entry.

Tested:

diff <(./ss.old -nltp) <(misc/ss -nltp)
38c38
< LISTEN   0  128   [::1]:35417  [::]:*  users:(("foo",pid=65254,fd=116))
\ No newline at end of file

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Brian Vazquez 2019-12-04 13:32:28 -08:00 committed by Stephen Hemminger
parent 908985c670
commit 9eee92a41a
1 changed files with 5 additions and 0 deletions

View File

@ -1290,6 +1290,11 @@ static void render(void)
token = buf_token_next(token);
}
/* Deal with final end-of-line when the last non-empty field printed
* is not the last field.
*/
if (line_started)
printf("\n");
buf_free_all();
current_field = columns;