]> granicus.if.org Git - procps-ng/commitdiff
top: Fix snprintf() call in capsmk().
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 21:32:34 +0000 (07:32 +1000)
Replace "snprintf(msg, sizeof(pmt)" with "snprintf(msg, sizeof(msg)".
Luckily sizeof(pmt) == sizeof(msg), but fix it anyway.

top/top.c

index eda3d265d5ef404f240d67be72318b8881f4b014..e9634f780e75b756e84d32c67879debcdb078718 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -836,7 +836,7 @@ static void capsmk (WIN_t *q) {
    } else {
       q->capclr_sum[0] = '\0';
 #ifdef USE_X_COLHDR
-      snprintf(q->capclr_msg, sizeof(q->capclr_pmt), "%s%s"
+      snprintf(q->capclr_msg, sizeof(q->capclr_msg), "%s%s"
          , Cap_reverse, q->cap_bold);
 #else
       STRLCPY(q->capclr_msg, Cap_reverse)