]> git.ipfire.org Git - pakfire.git/commitdiff
progressbar: Reset array with results
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 17:19:11 +0000 (17:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 17:19:11 +0000 (17:19 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/progressbar.c

index 081a1af88027281e3c3ca78789b04aedb345f7f4..22d70a3c147c4430dd0947c50559d6a767dfe25f 100644 (file)
@@ -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;