summaryrefslogtreecommitdiff
path: root/lib/rpmfi.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-21 14:28:13 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-08-21 14:28:13 +0300
commit4c0834f7255cf6480c497cc0f0eb144c8fcf405d (patch)
tree909c7d2465befe34304245aedafd4600ef47bfd1 /lib/rpmfi.c
parent500782b3d4b3d05bc33a7116757341159056928e (diff)
downloadlibrpm-tizen-4c0834f7255cf6480c497cc0f0eb144c8fcf405d.tar.gz
librpm-tizen-4c0834f7255cf6480c497cc0f0eb144c8fcf405d.tar.bz2
librpm-tizen-4c0834f7255cf6480c497cc0f0eb144c8fcf405d.zip
Cosmetics: compare memcmp() return code explicitly
- Comparing against zero is just that little bit more readable than the negated condition.
Diffstat (limited to 'lib/rpmfi.c')
-rw-r--r--lib/rpmfi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index f61b82508..52fd08cd5 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -641,19 +641,19 @@ rpmFileAction rpmfiDecideFateIndex(rpmfi ofi, int oix, rpmfi nfi, int nix,
if (diskWhat == REG) {
if (rpmDoDigest(oalgo, fn, 0, (unsigned char *)buffer, NULL))
return FA_CREATE; /* assume file has been removed */
- if (odigest && !memcmp(odigest, buffer, odiglen))
+ if (odigest && memcmp(odigest, buffer, odiglen) == 0)
return FA_CREATE; /* unmodified config file, replace. */
/* hash algo changed in new, recalculate digest */
if (oalgo != nalgo)
if (rpmDoDigest(nalgo, fn, 0, (unsigned char *)buffer, NULL))
return FA_CREATE; /* assume file has been removed */
- if (ndigest && !memcmp(ndigest, buffer, ndiglen))
+ if (ndigest && memcmp(ndigest, buffer, ndiglen) == 0)
return FA_CREATE; /* file identical in new, replace. */
}
/* Can't compare different hash types, backup to avoid data loss */
if (oalgo != nalgo || odiglen != ndiglen)
return save;
- if (odigest && ndigest && !memcmp(odigest, ndigest, odiglen))
+ if (odigest && ndigest && memcmp(odigest, ndigest, odiglen) == 0)
return FA_SKIP; /* identical file, don't bother. */
} else /* dbWhat == LINK */ {
const char * oFLink, * nFLink;
@@ -708,7 +708,7 @@ int rpmfiConfigConflictIndex(rpmfi fi, int ix)
const unsigned char *ndigest = rpmfiFDigestIndex(fi,ix, &algo, &diglen);
if (rpmDoDigest(algo, fn, 0, (unsigned char *)buffer, NULL))
return 0; /* assume file has been removed */
- if (ndigest && !memcmp(ndigest, buffer, diglen))
+ if (ndigest && memcmp(ndigest, buffer, diglen) == 0)
return 0; /* unmodified config file */
} else /* newWhat == LINK */ {
const char * nFLink;