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)
                {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to