From 94805ad55ae53039717a7f705fe41f0cbe0d8ebc Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Sat, 15 Nov 2014 00:13:13 +0530 Subject: [PATCH] Fix progress bar assertion --- src/ChangeLog | 7 ++++++- src/progress.c | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 32eebda4..d085953d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-11-15 Darshit Shah + + * progress.c (create_image): Fix assertion that checks progress bar length + Should fix bug #43593 + 2014-11-12 Tim Ruehsen * openssl.c (ssl_init): Fix error handling for CRL loading @@ -7,7 +12,7 @@ * html-parse.c (map_html_tags): Fix range check 2014-11-11 Tim Ruehsen - + * openssl.c (ssl_init): Load CRL file given by --crl-file 2014-11-11 Tim Ruehsen diff --git a/src/progress.c b/src/progress.c index a0b48e4f..d23654da 100644 --- a/src/progress.c +++ b/src/progress.c @@ -1158,7 +1158,15 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) while (p - bp->buffer - bytes_cols_diff < bp->width) *p++ = ' '; *p = '\0'; - assert (count_cols (bp->buffer) <= bp->width); + + /* 2014-11-14 Darshit Shah + * Assert that the length of the progress bar is lesser than the size of the + * screen with which we are dealing. This assertion *MUST* always be removed + * from the release code since we do not want Wget to crash and burn when the + * assertion fails. Instead Wget should continue downloading and display a + * horrible and irritating progress bar that spams the screen with newlines. + */ + assert (count_cols (bp->buffer) <= bp->width + 1); } /* Print the contents of the buffer as a one-line ASCII "image" so