ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-5.01.tar.gz
[xscreensaver] / hacks / piecewise.c
index 09fc4b621609ae0e2e371759a8c4562500f6b59c..0053eff2fc45ee7d8062c44c3480d88adc905de7 100644 (file)
@@ -358,7 +358,7 @@ static circle *init_circles(struct state *st, int n, int w, int h)
   dr = floor(maxradius * h) - r0 + 1;
 
   for (i=0;i<n;i++) {
-    c[i].r = r0 + random() % dr;
+    c[i].r = r0 + ((dr > 0) ? random() % dr : 0);
     c[i].x = c[i].r + frand(w - 1 - 2 * c[i].r);
     c[i].y = c[i].r + frand(h - 1 - 2 * c[i].r);
     c[i].visible = random() & 1;