From 62f8ed6c8ef489201a19f1e28656c58b363ba851 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 28 Jun 2021 10:05:09 -0400 Subject: console: Pacify `gcc -fanalyzer` It's not smart enough to follow the conditionals here to see that `textlen > 0` implies `text != NULL`. But the cost of an additional check is probably nil, so let's be robust to future code refactoring. --- glnx-console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glnx-console.c b/glnx-console.c index c2fe29d..0a96cdc 100644 --- a/glnx-console.c +++ b/glnx-console.c @@ -261,7 +261,7 @@ text_percent_internal (const char *text, const guint textlen = MIN (input_textlen, ncolumns - bar_min); const guint barlen = MIN (MAX_PROGRESSBAR_COLUMNS, ncolumns - (textlen + 1)); - if (textlen > 0) + if (text && textlen > 0) { fwrite (text, 1, textlen, stdout); fputc (' ', stdout); -- cgit v1.2.1