base: fix error_cmp

Fix the numeric error value comparison performed by error_cmp().

Identified by AppChecker and previously fixed by Darwin.

Change-Id: I0a72fd381bef0b34b7e7d155bfff03ab4196d38e
This commit is contained in:
Jeffrey Altman
2017-04-28 10:21:45 -04:00
parent 18f3115f78
commit 85acd57c8a

View File

@@ -53,8 +53,8 @@ static int
error_cmp(void *a, void *b)
{
struct heim_error *ap = a, *bp = b;
if (ap->error_code == ap->error_code)
return ap->error_code - ap->error_code;
if (ap->error_code == bp->error_code)
return 0;
return heim_cmp(ap->msg, bp->msg);
}