From 8d3f65e7673045c0d2f828bec00a0bab94b8af20 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Sun, 24 Jun 2018 13:14:04 +0000 Subject: [PATCH] top(1): increase field with width for W/CPU column This allows 3 digit CPU columns to look nice Reported by: feld --- usr.bin/top/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 5dfd68bdfe4c..8617a2fbd26f 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -398,7 +398,7 @@ format_header(const char *uname_field) sbuf_cat(header, "C "); } sbuf_cat(header, "TIME "); - sbuf_printf(header, "%6s ", ps.wcpu ? "WCPU" : "CPU"); + sbuf_printf(header, " %6s ", ps.wcpu ? "WCPU" : "CPU"); sbuf_cat(header, "COMMAND"); sbuf_finish(header); break; @@ -1084,7 +1084,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags } sbuf_printf(procbuf, "%3d ", cpu); } - sbuf_printf(procbuf, "%6s", format_time(cputime)); + sbuf_printf(procbuf, "%6s ", format_time(cputime)); sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); } sbuf_printf(procbuf, "%.*s",