From: Jim Warner Date: Sun, 6 Sep 2015 05:00:00 +0000 (-0500) Subject: w: eliminate inappropriate cmdline padding with spaces X-Git-Tag: v4.0.0~1042 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14359a0afe66cf4641c95b40c0d83c0fef9a892f;p=procps-ng w: eliminate inappropriate cmdline padding with spaces This commit is an outgrowth of the research into a bug involving the recently added enum 'PROCPS_PIDS_extra'. The WHAT portion of output is being padded with spaces since the printf field width format specifier was used in combination with a precision specifier. This commit reduces the format string to just that precision part. Signed-off-by: Jim Warner --- diff --git a/w.c b/w.c index 16828dd1..2130ce1f 100644 --- a/w.c +++ b/w.c @@ -488,7 +488,7 @@ static void showinfo( else print_time_ival7(idletime(tty), 0, stdout); } - printf(" %-*.*s\n", maxcmd, maxcmd, cmdline); + printf(" %.*s\n", maxcmd, cmdline); } static void __attribute__ ((__noreturn__))