aboutsummaryrefslogtreecommitdiff
path: root/quse.c
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-01-06 08:35:38 +0100
committerFabian Groffen <grobian@gentoo.org>2020-01-06 08:35:38 +0100
commitb7a9406bec657d4929b85c322d50440b48220fcf (patch)
tree25e58d6d32d2670303e78bbe582c0a57d959e262 /quse.c
parentlibq/tree: make some unused functions private (static) (diff)
downloadportage-utils-b7a9406bec657d4929b85c322d50440b48220fcf.tar.gz
portage-utils-b7a9406bec657d4929b85c322d50440b48220fcf.tar.bz2
portage-utils-b7a9406bec657d4929b85c322d50440b48220fcf.zip
qcheck/quse: address Coverity concerns
- it considers tmpfile() unsafe (?) - help it to see a variable was checked for NULL before Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'quse.c')
-rw-r--r--quse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/quse.c b/quse.c
index 358d9e02..dca2f1c3 100644
--- a/quse.c
+++ b/quse.c
@@ -432,7 +432,7 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
}
if (!state->do_licence) {
- if (tree_pkg_meta_get(pkg_ctx, IUSE) == NULL)
+ if ((q = tree_pkg_meta_get(pkg_ctx, IUSE)) == NULL)
return 0;
if (state->do_describe) {
@@ -454,15 +454,14 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
use = add_set(p, use);
}
} else {
- if (tree_pkg_meta_get(pkg_ctx, LICENSE) == NULL)
+ if ((q = tree_pkg_meta_get(pkg_ctx, LICENSE)) == NULL)
return 0;
}
maxlen = 0;
cnt = 0;
match = false;
- q = p = state->do_licence ?
- tree_pkg_meta_get(pkg_ctx, LICENSE) : tree_pkg_meta_get(pkg_ctx, IUSE);
+ p = q; /* set to IUSE or LICENSE above */
buf[0] = '\0';
v = buf;
w = buf + sizeof(buf);