From 9d1fdb5c4c83b494cbd00ba301d2245af59c6b3f Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sat, 1 Feb 2020 21:58:04 +0100 Subject: [PATCH] prevent division-by-zero in progress bar --- multiboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multiboot.c b/multiboot.c index bf628c9..0945153 100644 --- a/multiboot.c +++ b/multiboot.c @@ -82,7 +82,7 @@ static void progress_mode0_cb(const char *msg, int pos, int size) * ************************************************************************* */ static void progress_mode1_cb(const char *msg, int pos, int size) { - if (pos != -1 && size != -1) + if (pos != -1 && size > 0) { char stars[51]; int i; @@ -111,7 +111,7 @@ static void progress_mode2_cb(const char *msg, int pos, int size) { static int old_count; - if (pos != -1 && size != -1) + if (pos != -1 && size > 0) { if (pos == 0) {