mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Pearl: fix bounds check in previous commit.
Ahem. That's what I get for testing the fix on a square puzzle.
This commit is contained in:
2
pearl.c
2
pearl.c
@ -873,7 +873,7 @@ cleanup:
|
|||||||
for (d = 1; d <= 8; d += d) {
|
for (d = 1; d <= 8; d += d) {
|
||||||
int nx = x + DX(d), ny = y + DY(d);
|
int nx = x + DX(d), ny = y + DY(d);
|
||||||
int rlink;
|
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);
|
rlink = result[ny*w+nx] & F(d);
|
||||||
else
|
else
|
||||||
rlink = 0; /* off-board squares don't link back */
|
rlink = 0; /* off-board squares don't link back */
|
||||||
|
Reference in New Issue
Block a user