diff options
author | Alexey Tourbin <at@altlinux.ru> | 2010-04-21 11:10:15 +0400 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-04-21 11:53:25 +0300 |
commit | c0ab315e71c46e36de038dde4a32ebe6eba04c41 (patch) | |
tree | 21b02994c1140c46cccbd8116b809d4b2d55bc41 | |
parent | da6e66a9b28f21f81a5e9ce1ce760e26e2a5bdd9 (diff) | |
download | rpm-c0ab315e71c46e36de038dde4a32ebe6eba04c41.tar.gz rpm-c0ab315e71c46e36de038dde4a32ebe6eba04c41.tar.bz2 rpm-c0ab315e71c46e36de038dde4a32ebe6eba04c41.zip |
rpmdb.c (dbiOpen): fix dbix condition
In the loop, dbix is always initialized to 0, so checking (dbix < 0)
is uselss. Insetead, we sould check (dbix >= dbiTagsMax).
-rw-r--r-- | lib/rpmdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c index d299e9c9d..43f86e9a5 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -122,7 +122,7 @@ static inline pbm_set * PBM_REALLOC(pbm_set ** sp, int * odp, int nd) */ static dbiIndex rpmdbOpenIndex(rpmdb db, rpmTag rpmtag, unsigned int flags) { - int dbix = -1; + int dbix; dbiIndex dbi = NULL; int _dbapi, _dbapi_rebuild, _dbapi_wanted; int rc = 0; @@ -134,7 +134,7 @@ static dbiIndex rpmdbOpenIndex(rpmdb db, rpmTag rpmtag, unsigned int flags) if (rpmtag == dbiTags[dbix]) break; } - if (dbix < 0) + if (dbix >= dbiTagsMax) return NULL; /* Is this index already open ? */ |