From: Michael Tremer Date: Mon, 19 Apr 2021 17:19:11 +0000 (+0000) Subject: progressbar: Reset array with results X-Git-Tag: 0.9.28~1285^2~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93137762871927d922a6861a1c2ecca5b73fa0ef;p=pakfire.git progressbar: Reset array with results Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/progressbar.c b/src/libpakfire/progressbar.c index 081a1af88..22d70a3c1 100644 --- a/src/libpakfire/progressbar.c +++ b/src/libpakfire/progressbar.c @@ -352,6 +352,10 @@ static int pakfire_progressbar_redraw(struct pakfire_progressbar* p) { // Create an array with the result of all print functions const char* elements[p->num_widgets]; + // Reset all elements + for (unsigned int i = 0; i < p->num_widgets; i++) + elements[i] = NULL; + // Process all non-expandable widgets in the first pass STAILQ_FOREACH(widget, &p->widgets, nodes) { const char* element = NULL;