]> git.ipfire.org Git - pakfire.git/commitdiff
cli: progressbar: Increment the size of the bar buffer
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 2 Oct 2023 10:12:06 +0000 (10:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 2 Oct 2023 10:12:06 +0000 (10:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/lib/progressbar.c

index 08bb02f083f33c11297864311c7f60908343e8ec..709707c6d6988583d5471cd5da030d2c9ddbd7ae 100644 (file)
@@ -363,7 +363,7 @@ static int cli_progressbar_add_percentage(struct cli_progressbar* p) {
 static const char* cli_progressbar_bar(struct cli_progressbar* p,
                struct cli_progressbar_widget* widget, unsigned int width, void* data) {
        // Allocate or adjust the buffer
-       widget->buffer = realloc(widget->buffer, width);
+       widget->buffer = realloc(widget->buffer, width + 1);
 
        // Fail if we could not allocate the buffer
        if (!widget->buffer)