From 847648d5e630ab86e07a62747fccb423b9d726d2 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Mon, 20 Dec 2010 22:51:03 +0000 Subject: [PATCH] I hate stupid bugs like this one --- animations/bitmapscroller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/animations/bitmapscroller.c b/animations/bitmapscroller.c index e7bc1f5..56f45f7 100644 --- a/animations/bitmapscroller.c +++ b/animations/bitmapscroller.c @@ -194,8 +194,8 @@ void bitmap_scroll(unsigned int const nWidth, bitmap.nChunkCount = (((bitmap.nViewportWidth - 1) / 8) + 1); // initial starting point - int x = random8() % (bitmap.nXDomain + 1); - int y = random8() % (bitmap.nYDomain + 1); + int x = bitmap.nXDomain > 0 ? random8() % bitmap.nXDomain : 0; + int y = bitmap.nYDomain > 0 ? random8() % bitmap.nYDomain : 0; char dx = 0; char dy = 0;