From: Panu Matilainen Date: Fri, 26 Mar 2010 05:09:47 +0000 (+0200) Subject: Handle NULL and the same literal problem pointer in rpmProblemCompare() X-Git-Tag: tznext/4.11.0.1.tizen20130304~2130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34ddaa716174e29c42f005e3546dbbeeb60c7057;p=tools%2Flibrpm-tizen.git Handle NULL and the same literal problem pointer in rpmProblemCompare() - if the pointers to compare are the same, the problem is the same (even if NULL for our purposes) - if they're not the same and either is NULL then they're not the same --- diff --git a/lib/rpmprob.c b/lib/rpmprob.c index 1a5eef2..511a5b1 100644 --- a/lib/rpmprob.c +++ b/lib/rpmprob.c @@ -200,6 +200,10 @@ static int cmpStr(const char *s1, const char *s2) int rpmProblemCompare(rpmProblem ap, rpmProblem bp) { + if (ap == bp) + return 0; + if (ap == NULL || bp == NULL) + return 1; if (ap->type != bp->type) return 1; if (ap->key != bp->key)