svn commit: r335601 - head/usr.bin/top

Eitan Adler eadler at FreeBSD.org
Sun Jun 24 13:14:05 UTC 2018


Author: eadler
Date: Sun Jun 24 13:14:04 2018
New Revision: 335601
URL: https://svnweb.freebsd.org/changeset/base/335601

Log:
  top(1): increase field with width for W/CPU column
  
  This allows 3 digit CPU columns to look nice
  
  Reported by:	feld

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Sun Jun 24 13:08:05 2018	(r335600)
+++ head/usr.bin/top/machine.c	Sun Jun 24 13:14:04 2018	(r335601)
@@ -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 *(*g
 			}
 			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",


More information about the svn-src-head mailing list