git: 092e2ff33be2 - main - ps.1: restore always true if predicate

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 14 Nov 2024 02:41:59 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=092e2ff33be2fbe878ad65fe2e9daea918e35e39

commit 092e2ff33be2fbe878ad65fe2e9daea918e35e39
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-14 02:16:51 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-14 02:41:42 +0000

    ps.1: restore always true if predicate
    
    Fixes:  62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e
    Reported and reviewed by:       jlduran
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D47561
---
 bin/ps/ps.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 49c69bb76084..3257f0885aa0 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1268,7 +1268,6 @@ static void
 saveuser(KINFO *ki)
 {
 	char tdname[COMMLEN + 1];
-	char *argsp;
 
 	ki->ki_valid = 1;
 
@@ -1278,14 +1277,11 @@ saveuser(KINFO *ki)
 	if (needcomm) {
 		if (ki->ki_p->ki_stat == SZOMB) {
 			ki->ki_args = strdup("<defunct>");
-		} else if (ki->ki_p->ki_args != NULL) {
+		} else {
 			(void)snprintf(tdname, sizeof(tdname), "%s%s",
 			    ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname);
 			ki->ki_args = fmt(kvm_getargv, ki,
 			    ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1);
-		} else {
-			asprintf(&argsp, "(%s)", ki->ki_p->ki_comm);
-			ki->ki_args = argsp;
 		}
 		if (ki->ki_args == NULL)
 			xo_errx(1, "malloc failed");