top: fix previous fix of the coverity CID #427133 flaw

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/356
. Oct, 2024 - original fix
commit 3faac96eec

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2024-11-04 06:00:00 -06:00 committed by Craig Small
parent 39aab8c464
commit 50e167bf4c

View File

@ -251,14 +251,14 @@ static const char Osel_filterI_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%*s\n";
/* Support for adjoining display (if terminal is wide enough) */ /* Support for adjoining display (if terminal is wide enough) */
#ifdef TOG4_SEP_OFF #ifdef TOG4_SEP_OFF
static char Adjoin_sp[] = " "; static char Adjoin_sp[] = " ";
#define ADJOIN_space (int)(sizeof(Adjoin_sp) - 1) // 1 for null #define ADJOIN_space ((int)(sizeof(Adjoin_sp) - 1)) // 1 for null
#else #else
#ifdef TOG4_SEP_STD #ifdef TOG4_SEP_STD
static char Adjoin_sp[] = "~1 ~6 "; static char Adjoin_sp[] = "~1 ~6 ";
#else #else
static char Adjoin_sp[] = " ~6 ~1"; static char Adjoin_sp[] = " ~6 ~1";
#endif #endif
#define ADJOIN_space (int)(sizeof(Adjoin_sp) - 5) // 1 for null + 4 unprintable #define ADJOIN_space ((int)(sizeof(Adjoin_sp) - 5)) // 1 for null + 4 unprintable
#endif #endif
#define ADJOIN_limit 8 #define ADJOIN_limit 8