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
This commit is contained in:
Alan Somers 2018-06-19 18:32:06 +00:00
parent 1ef447f923
commit aa9d9bfa90

View File

@ -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)
{