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

Alan Somers asomers at FreeBSD.org
Tue Jun 19 18:32:07 UTC 2018


Author: asomers
Date: Tue Jun 19 18:32:06 2018
New Revision: 335381
URL: https://svnweb.freebsd.org/changeset/base/335381

Log:
  top(1): Fix Coverity warning
  
  Don't call strerror on negative errnos
  
  Reported by:	Coverity
  CID:		976708
  Reviewed by:	eadler
  Differential Revision:	https://reviews.freebsd.org/D15909

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

Modified: head/usr.bin/top/commands.c
==============================================================================
--- head/usr.bin/top/commands.c	Tue Jun 19 18:25:43 2018	(r335380)
+++ head/usr.bin/top/commands.c	Tue Jun 19 18:32:06 2018	(r335381)
@@ -242,7 +242,7 @@ err_string(void)
 	errp = &(errs[cnt++]);
 	if (errp->errnum != currerr)
 	{
-	    if (currerr != -1)
+	    if (currerr >= 0)
 	    {
 		if ((stringlen = str_adderr(string, stringlen, currerr)) < 2)
 		{


More information about the svn-src-head mailing list