rnd-20030503-1-src
[rocksndiamonds.git] / src / libgame / misc.c
index 10656e46a208fdcc0cf746b226c3345374eece9f..60aff1cca96ed5772fbe1475ddb86091a56c853e 100644 (file)
@@ -324,7 +324,7 @@ unsigned int init_random_number(int nr, long seed)
 
 unsigned int get_random_number(int nr, unsigned int max)
 {
-  return (random_linux_libc(nr) % max);
+  return (max > 0 ? random_linux_libc(nr) % max : 0);
 }