summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-06-20 00:00:00 -0500
committerCraig Small <csmall@dropbear.xyz>2022-06-20 21:43:44 +1000
commit73757f8bb9ce3ba48a552df9f228567190fece26 (patch)
tree8c3ad0e6f2775d1fd321273f6b7578766e2d2ddf
parent706e4adea195c8a58eb944f7b72bb0edd4ee3b6d (diff)
downloadprocps-ng-73757f8bb9ce3ba48a552df9f228567190fece26.tar.gz
top: adjust some parenthesis for correct '^N' behavior <=== port of newlib 3c7f8199
______________________________ original newlib message Some kdeinit tasks have a large environment consisting mostly of nulls which were then followed by one or two printable characters. Such strange environments should not be shown with that 'not applicable' (n/a) notation even though that first string vector is equal to '\0'. I thought I had covered such a contingency but, due to a misplaced right parenthesis, that '^N' bottom window could see 'n/a' + a bunch of spaces + printable stuff. Well, that won't happen anymore with this tiny change. Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r--top/top.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/top/top.c b/top/top.c
index 5f2d27e..9e3574f 100644
--- a/top/top.c
+++ b/top/top.c
@@ -5245,7 +5245,7 @@ static int bot_focus_strv (const char *hdr, const char **strv) {
n = (char *)&strv[0] - strv[0];
if (n >= sizeof(Bot_buf)) n = sizeof(Bot_buf) - 1;
memcpy(Bot_buf, strv[0], n);
- if (!Bot_buf[0] || (!strcmp(Bot_buf, "-") && n <= sizeof(char *)))
+ if ((!Bot_buf[0] || !strcmp(Bot_buf, "-")) && n <= sizeof(char *))
strcpy(Bot_buf, N_txt(X_BOT_nodata_txt));
for (nsav= 0, p = Bot_buf, x = 0; strv[nsav] != NULL; nsav++) {
p += strlen(strv[nsav]) + 1;