Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2018 18:32:06 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335381 - head/usr.bin/top
Message-ID:  <201806191832.w5JIW6Nd046076@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 		{



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