aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2009-12-27 19:18:22 +0000
committerSimon Tatham <anakin@pobox.com>2009-12-27 19:18:22 +0000
commitb629e34beb60fcf2e880012e00cca52d0cf2fe39 (patch)
tree977ead1767fd0b2ce120feae8cd336d15fe427f3
parent514bd502be62be1b645e13488740fd34f8674d47 (diff)
downloadpuzzles-b629e34beb60fcf2e880012e00cca52d0cf2fe39.zip
puzzles-b629e34beb60fcf2e880012e00cca52d0cf2fe39.tar.gz
puzzles-b629e34beb60fcf2e880012e00cca52d0cf2fe39.tar.bz2
puzzles-b629e34beb60fcf2e880012e00cca52d0cf2fe39.tar.xz
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]
-rw-r--r--unequal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unequal.c b/unequal.c
index 459e35f..8c56509 100644
--- 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;