X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fmaze.c;h=811aca31f6786bca6b7c62149da893c90e0d4fac;hb=3243731044b944673630b55e16674c191b026f84;hp=d963ad3e754ac48ef77664ab6eb86d409a66ac18;hpb=7b34ef992563d7bcbb64cc5597dc45fa24470b05;p=xscreensaver diff --git a/hacks/maze.c b/hacks/maze.c index d963ad3e..811aca31 100644 --- a/hacks/maze.c +++ b/hacks/maze.c @@ -210,12 +210,17 @@ set_maze_sizes (struct state *st, int width, int height) static void initialize_maze (struct state *st) { + int retry_count = 0; int i, j, wall; int logow = 1 + st->logo_width / st->grid_width; int logoh = 1 + st->logo_height / st->grid_height; AGAIN: + /* This can happen if the window is really small. Let's not sweat it. */ + if (++retry_count > 100) return; + + /* initialize all squares */ for ( i=0; imaze_size_x; i++) { for ( j=0; jmaze_size_y; j++) {