From 14359a0afe66cf4641c95b40c0d83c0fef9a892f Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Sun, 6 Sep 2015 00:00:00 -0500 Subject: [PATCH] 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 --- w.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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__))