shithub: puzzles

Download patch

ref: b629e34beb60fcf2e880012e00cca52d0cf2fe39
parent: 514bd502be62be1b645e13488740fd34f8674d47
author: Simon Tatham <anakin@pobox.com>
date: Sun Dec 27 14:18:22 EST 2009

Fix bug causing array overrun. Only seemed to be showing a symptom
on Windows, presumably because the data after the array was harmless
elsewhere.

[originally from svn r8798]

--- a/unequal.c
+++ b/unequal.c
@@ -728,7 +728,7 @@
 
     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;