From db5240f340a6baa57f9e8ddd6200ac209d3b1a5c Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 30 Jan 2001 13:29:27 +0000 Subject: prevent from trying to set progressbar to more than 100% (rescue is more compressed than drakx) --- mdk-stage1/stdio-frontend.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mdk-stage1/stdio-frontend.c') diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c index 277c47da1..85b8c94ad 100644 --- a/mdk-stage1/stdio-frontend.c +++ b/mdk-stage1/stdio-frontend.c @@ -146,10 +146,11 @@ void init_progression(char *msg, int size) void update_progression(int current_size) { if (size_progress) { - while ((int)((current_size*PROGRESS_SIZE)/size_progress) > actually_drawn) { - printf("*"); - actually_drawn++; - } + if (current_size <= size_progress) + while ((int)((current_size*PROGRESS_SIZE)/size_progress) > actually_drawn) { + printf("*"); + actually_drawn++; + } } else printf("\033[G%d bytes read", current_size); -- cgit v1.2.1