mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
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:
parent
44aedd8321
commit
7cb9efa668
@ -1164,7 +1164,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
|
|||||||
}
|
}
|
||||||
|
|
||||||
padding = bp->width - count_cols (bp->buffer);
|
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;
|
padding = padding > 0 ? padding : 0;
|
||||||
memset (p, ' ', padding);
|
memset (p, ' ', padding);
|
||||||
p += padding;
|
p += padding;
|
||||||
|
Loading…
Reference in New Issue
Block a user