mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Fix array bounds violation in the solver. Oops.
[originally from svn r6225]
This commit is contained in:
@ -370,7 +370,9 @@ static int find_gem_candidates(int w, int h, char *grid,
|
|||||||
d2 = n;
|
d2 = n;
|
||||||
}
|
}
|
||||||
i2 = (y2*w+x2)*DIRECTIONS+d2;
|
i2 = (y2*w+x2)*DIRECTIONS+d2;
|
||||||
if (!reachable[i2]) {
|
if (x2 >= 0 && x2 < w &&
|
||||||
|
y2 >= 0 && y2 < h &&
|
||||||
|
!reachable[i2]) {
|
||||||
int ok;
|
int ok;
|
||||||
#ifdef SOLVER_DIAGNOSTICS
|
#ifdef SOLVER_DIAGNOSTICS
|
||||||
printf(" trying point %d,%d,%d", x2, y2, d2);
|
printf(" trying point %d,%d,%d", x2, y2, d2);
|
||||||
|
Reference in New Issue
Block a user