chiark / gitweb /
Fix bug causing array overrun. Only seemed to be showing a symptom
[sgt-puzzles.git] / unequal.c
index 459e35fbf53e20eb62da3a64acab9ce67777f933..8c56509d99dd940ba8ce2696e4940f17df0c1a31 100644 (file)
--- a/unequal.c
+++ b/unequal.c
@@ -728,7 +728,7 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
 
     for (x = 0; x < o; x++) {
         for (y = 0; y < o; y++) {
-            for (i = 0; i < o; i++) {
+            for (i = 0; i < 4; i++) {
                 int isadjacent = (GRID(ctx->state, flags, x, y) & adjthan[i].f);
 
                 nx = x + adjthan[i].dx, ny = y + adjthan[i].dy;