Fix assertion in Progress bar

* src/progress.c (create_image): Fix off-by-one error in assert()
    statement for progress bar width.
    Reported-By: Gisle Vanem <gvanem@yahoo.no>
This commit is contained in:
Darshit Shah 2016-03-05 11:58:53 +01:00
parent 44aedd8321
commit 7cb9efa668
1 changed files with 1 additions and 1 deletions

View File

@ -1164,7 +1164,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
}
padding = bp->width - count_cols (bp->buffer);
assert (padding > 0 && "Padding length became non-positive!");
assert (padding >= 0 && "Padding length became non-positive!");
padding = padding > 0 ? padding : 0;
memset (p, ' ', padding);
p += padding;