commit:     b063fed2887ffb9702752de902de51c7828b92d2
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 13 12:44:48 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Nov 13 12:44:48 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b063fed2

qlop: fix crash due to unwanted side-effect in conditional

Thanks Agostino Sarubbo for reporting

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

 qlop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qlop.c b/qlop.c
index 7083ea7..601ad87 100644
--- a/qlop.c
+++ b/qlop.c
@@ -426,9 +426,9 @@ static int do_emerge_log(
 
                        atom = NULL;
                        if (strncmp(p, "  >>> emerge ", 13) == 0 &&
-                                       (p = strchr(p + 13, ')')) != NULL)
+                                       (q = strchr(p + 13, ')')) != NULL)
                        {
-                               p += 2;
+                               p = q + 2;
                                q = strchr(p, ' ');
                                if (q != NULL) {
                                        *q = '\0';

Reply via email to