From: Stefano Brivio Date: Tue, 31 Oct 2017 17:47:54 +0000 (+0100) Subject: ss: Remove useless width specifier in process context print X-Git-Tag: v4.14.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38509fa903d66cf13f3c8ca5010db820fb874064;p=thirdparty%2Fiproute2.git ss: Remove useless width specifier in process context print Both local address and service, and remote address and service fields are already printed out in netlink_show_one() before we start printing process context, by calling sock_addr_print() twice. At this point, sock_addr_print() has already forced the remote service field to be 'serv_width' wide -- that is, 'serv_width' width has already been consumed, before we print process context. Hence, it makes no sense to force the display width of process context to be 'serv_width' wide again: previous prints have filled up the line already. Remove the width specifier and prefix with a space instead, to keep this consistent with fields which are displayed after the first output line. Signed-off-by: Stefano Brivio --- diff --git a/misc/ss.c b/misc/ss.c index dfb438f91..fa026eb09 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3594,10 +3594,10 @@ static int netlink_show_one(struct filter *f, getpidcon(pid, &pid_context); if (pid_context != NULL) { - printf("proc_ctx=%-*s ", serv_width, pid_context); + printf(" proc_ctx=%s", pid_context); free(pid_context); } else { - printf("proc_ctx=%-*s ", serv_width, "unavailable"); + printf(" proc_ctx=unavailable"); } }