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

Eitan Adler eadler at FreeBSD.org
Tue May 22 07:57:00 UTC 2018


Author: eadler
Date: Tue May 22 07:56:58 2018
New Revision: 334025
URL: https://svnweb.freebsd.org/changeset/base/334025

Log:
  top(1): increase size of 'status' buffer
  
  This corrects a warning issues by gcc9:
  /srv/src/freebsd/head/usr.bin/top/machine.c:988:22: warning: '%5zu'
  directive writing between 5 and 20 bytes into a
   region of size 15 [-Wformat-overflow=]
       sprintf(status, "?%5zu", state);

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

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Tue May 22 07:20:22 2018	(r334024)
+++ head/usr.bin/top/machine.c	Tue May 22 07:56:58 2018	(r334025)
@@ -920,7 +920,7 @@ format_next_process(caddr_t xhandle, char *(*get_useri
 	long cputime;
 	double pct;
 	struct handle *hp;
-	char status[16];
+	char status[22];
 	int cpu;
 	size_t state;
 	struct rusage ru, *rup;


More information about the svn-src-head mailing list