From 67dc7b21cae44627d0ee55aedb90e421f58ac9c9 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Wed, 17 Oct 2012 19:39:34 +0200 Subject: fbsplash: fix regression from e4fa7b7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e4fa7b7 (limit progress bar flicker) made the progress bar counter unsigned causing i < 0 to never come true. Signed-off-by: Timo Teräs Signed-off-by: Denys Vlasenko --- miscutils/fbsplash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'miscutils/fbsplash.c') diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 37ca66559..05a77da23 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c @@ -312,8 +312,7 @@ static void fb_drawprogressbar(unsigned percent) pos_x = left_x; if (percent > 0) { - int y; - unsigned i; + int i, y; // actual progress bar pos_x += (unsigned)(width * percent) / 100; @@ -325,7 +324,7 @@ static void fb_drawprogressbar(unsigned percent) while (i >= 0) { // draw one-line thick "rectangle" // top line will have gray lvl 200, bottom one 100 - unsigned gray_level = 100 + i*100 / height; + unsigned gray_level = 100 + (unsigned)i*100 / height; fb_drawfullrectangle( left_x, y, pos_x, y, gray_level, gray_level, gray_level); -- cgit v1.2.3