commit:     ea84ef6ee024de6a24e0ee2f0cf557213a05c6b9
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 12 17:08:42 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Feb 12 17:08:42 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ea84ef6e

qmerge: fix Coverity dead code CID 248871

we previously checked rpkg == NULL, so indeed it can never be !NULL
(copy 'n' paste error)

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qmerge.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qmerge.c b/qmerge.c
index c41b095..a64447e 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1523,12 +1523,12 @@ pkg_unmerge(tree_pkg_ctx *pkg_ctx, depend_atom *rpkg, 
set *keep,
        if (!pretend && rpkg == NULL) {
                buf = tree_pkg_meta_get(pkg_ctx, EAPI);
                if (buf == NULL)
-                       buf = "0";  /* default */
+                       buf = (char *)"0";  /* default */
                phases = tree_pkg_meta_get(pkg_ctx, DEFINED_PHASES);
                if (phases != NULL) {
                        mkdirat(pkg_ctx->fd, "temp", 0755);
                        pkg_run_func_at(pkg_ctx->fd, ".", phases, PKG_PRERM,
-                                       T, T, buf, rpkg == NULL ? "" : 
rpkg->PVR);
+                                                       T, T, buf, "");
                }
        }
 
@@ -1664,7 +1664,7 @@ pkg_unmerge(tree_pkg_ctx *pkg_ctx, depend_atom *rpkg, set 
*keep,
                buf = tree_pkg_meta_get(pkg_ctx, EAPI);
                phases = tree_pkg_meta_get(pkg_ctx, DEFINED_PHASES);
                if (buf == NULL)
-                       buf = "0";  /* default */
+                       buf = (char *)"0";  /* default */
                if (phases != NULL) {
                        /* execute the pkg_postrm step */
                        pkg_run_func_at(pkg_ctx->fd, ".", phases, PKG_POSTRM,

Reply via email to