Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2018 02:54:32 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335881 - head/usr.bin/top
Message-ID:  <201807030254.w632sWAs039797@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Tue Jul  3 02:54:32 2018
New Revision: 335881
URL: https://svnweb.freebsd.org/changeset/base/335881

Log:
  When toggling the display using the "m" command to toggle from 'cpu'
  mode to 'io' mode, an artifact remains because the buffer is not
  "finished" with a NULL terminator using sbuf_finish().
  
  An example of this is, when the "m" command is entered, the title line
  will contain COMMANDND instead of COMMAND. This commit fixes this.

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

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Tue Jul  3 02:50:07 2018	(r335880)
+++ head/usr.bin/top/machine.c	Tue Jul  3 02:54:32 2018	(r335881)
@@ -408,6 +408,7 @@ format_header(const char *uname_field)
 		    ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : "",
 		    namelength, namelength, uname_field);
 		sbuf_cat(header, "   VCSW  IVCSW   READ  WRITE  FAULT  TOTAL PERCENT COMMAND");
+		sbuf_finish(header);
 		break;
 	}
 	case DISP_MAX:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807030254.w632sWAs039797>