aboutsummaryrefslogtreecommitdiff
path: root/pearl.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-02-05 12:05:28 +0000
committerSimon Tatham <anakin@pobox.com>2023-02-05 12:05:28 +0000
commit9ce0a6d93212ffc0986a2b399fd8e9e983f62904 (patch)
treea4f04fe4b8456906e647630907514b03bff43c57 /pearl.c
parent05c536e50d0c3114e1de5283eac97ff22bad0fc7 (diff)
downloadpuzzles-9ce0a6d93212ffc0986a2b399fd8e9e983f62904.zip
puzzles-9ce0a6d93212ffc0986a2b399fd8e9e983f62904.tar.gz
puzzles-9ce0a6d93212ffc0986a2b399fd8e9e983f62904.tar.bz2
puzzles-9ce0a6d93212ffc0986a2b399fd8e9e983f62904.tar.xz
Pearl: fix bounds check in previous commit.
Ahem. That's what I get for testing the fix on a square puzzle.
Diffstat (limited to 'pearl.c')
-rw-r--r--pearl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pearl.c b/pearl.c
index 04745f3..f6617a2 100644
--- a/pearl.c
+++ b/pearl.c
@@ -873,7 +873,7 @@ cleanup:
for (d = 1; d <= 8; d += d) {
int nx = x + DX(d), ny = y + DY(d);
int rlink;
- if (0 <= nx && nx < w && 0 <= ny && ny < w)
+ if (0 <= nx && nx < w && 0 <= ny && ny < h)
rlink = result[ny*w+nx] & F(d);
else
rlink = 0; /* off-board squares don't link back */