summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-14 20:26:48 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-14 20:26:48 +0300
commitedf03b155ba419b00dde585b3d35969621a024df (patch)
treec397c917cd6898101cd840790f2e24523057e14d /src/index.c
parent59d15ab2599777b24e65fad7a1fb052de4f5ef38 (diff)
downloadapk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.gz
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.bz2
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.xz
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.zip
audit, index, search, upgrade: use foreach_array_item
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/index.c b/src/index.c
index 26cbe72..2e93209 100644
--- a/src/index.c
+++ b/src/index.c
@@ -92,7 +92,7 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv)
struct counts counts = {0};
struct apk_ostream *os;
struct apk_file_info fi;
- int total, r, i, j, found, newpkgs = 0, errors = 0;
+ int total, r, i, found, newpkgs = 0, errors = 0;
struct index_ctx *ictx = (struct index_ctx *) ctx;
struct apk_package *pkg;
@@ -119,6 +119,7 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv)
found = FALSE;
do {
+ struct apk_provider *p;
struct apk_name *name;
char *fname, *fend;
apk_blob_t bname, bver;
@@ -145,8 +146,8 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv)
if (name == NULL)
break;
- for (j = 0; j < name->providers->num; j++) {
- pkg = name->providers->item[j].pkg;
+ foreach_array_item(p, name->providers) {
+ pkg = p->pkg;
if (pkg->name != name)
continue;
if (apk_blob_compare(bver, *pkg->version) != 0)