svn commit: r355072 - stable/12/usr.bin/top

Mark Johnston markj at FreeBSD.org
Mon Nov 25 00:33:57 UTC 2019


Author: markj
Date: Mon Nov 25 00:33:56 2019
New Revision: 355072
URL: https://svnweb.freebsd.org/changeset/base/355072

Log:
  MFC r354829:
  Add a "B" suffix to memory quantities in top(1) output.

Modified:
  stable/12/usr.bin/top/utils.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/top/utils.c
==============================================================================
--- stable/12/usr.bin/top/utils.c	Sun Nov 24 23:46:29 2019	(r355071)
+++ stable/12/usr.bin/top/utils.c	Mon Nov 25 00:33:56 2019	(r355072)
@@ -291,13 +291,14 @@ format_time(long seconds)
 char *
 format_k(int64_t amt)
 {
-    static char retarray[NUM_STRINGS][16];
-    static int index_ = 0;
-    char *ret;
+	static char retarray[NUM_STRINGS][16];
+	static int index_ = 0;
+	char *ret;
 
-    ret = retarray[index_];
+	ret = retarray[index_];
 	index_ = (index_ + 1) % NUM_STRINGS;
-	humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE);
+	humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE |
+	    HN_B);
 	return (ret);
 }
 


More information about the svn-src-all mailing list