aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qdepends.c1
-rw-r--r--qmanifest.c8
-rw-r--r--qpkg.c4
3 files changed, 7 insertions, 6 deletions
diff --git a/qdepends.c b/qdepends.c
index 1ecfab5..6afcb1c 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -416,6 +416,7 @@ int qdepends_main(int argc, char **argv)
array_for_each(overlays, n, overlay) {
t = tree_open(portroot, overlay);
if (t != NULL) {
+ state.rtree = NULL;
if (state.resolve)
state.rtree = tree_open(portroot, overlay);
if (!(state.qmode & QMODE_REVERSE) && array_cnt(atoms) > 0) {
diff --git a/qmanifest.c b/qmanifest.c
index 5246fc4..555e3c7 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -1357,8 +1357,8 @@ verify_dir(
}
}
- while (dentrieslen-- > 0)
- free(dentries[dentrieslen]);
+ for (curdentry = 0; curdentry < dentrieslen; curdentry++)
+ free(dentries[curdentry]);
free(dentries);
#pragma omp parallel for shared(ret) private(entry, etpe, slash)
@@ -1497,8 +1497,8 @@ verify_manifest(
ret = verify_dir(dir, elems, elemslen, 0, buf + 2, msgs);
checked_manifests++;
- while (elemslen-- > 0)
- free(elems[elemslen]);
+ for (elemssize = 0; elemssize < elemslen; elemssize++)
+ free(elems[elemssize]);
free(elems);
return ret;
diff --git a/qpkg.c b/qpkg.c
index c165989..85dbbcf 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -101,9 +101,9 @@ qpkg_clean(char *dirp)
if (known_pkgs != NULL) {
/* check which binpkgs exist in the known_pkgs (vdb or trees), such
* that the remainder is what we would clean */
- array_for_each(bins, n, binatomstr) {
+ array_for_each_rev(bins, n, binatomstr) {
if (contains_set(binatomstr, known_pkgs))
- xarraydelete_ptr(bins, n--);
+ xarraydelete_ptr(bins, n);
}
free_set(known_pkgs);