From b1a9bc966b674e657429559cb0e601793dcee099 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 9 Apr 2026 16:32:16 +0200 Subject: [PATCH] tools: fix compiler error on older compilers COLS could be very small and the statusbar array might overflow with strcpy and strcat. Also initializing the variable array seems to cause problems on older compilers. Instead use a fixed array that is big enough to hold all possible values we write into it. --- src/tools/pw-top.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/pw-top.c b/src/tools/pw-top.c index ecbdba0c2..824559f6a 100644 --- a/src/tools/pw-top.c +++ b/src/tools/pw-top.c @@ -581,7 +581,8 @@ static void do_refresh(struct data *d, bool force_refresh) return; if (!d->batch_mode) { - char statusbar[COLS] = {}; + char statusbar[255] = { 0 }; + if (!((filter->state == PW_NODE_STATE_ERROR) && (filter->followers == PW_NODE_STATE_ERROR))) {