aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-31 17:46:22 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-31 17:46:22 +0000
commitc11f9ff173763e92155838d79a5ea130c5693540 (patch)
tree375f2b2343cf9a8682819938c61d1e4667834a99
parent274423eaf868c4fdcff68d4825c8294b5359b170 (diff)
downloadpuzzles-c11f9ff173763e92155838d79a5ea130c5693540.zip
puzzles-c11f9ff173763e92155838d79a5ea130c5693540.tar.gz
puzzles-c11f9ff173763e92155838d79a5ea130c5693540.tar.bz2
puzzles-c11f9ff173763e92155838d79a5ea130c5693540.tar.xz
valgrind spotted this array underrun. I wonder if this might have
been causing some of Verity's nonreproducible weirdnesses. [originally from svn r5884]
-rw-r--r--mines.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mines.c b/mines.c
index 5023faa..a6562f6 100644
--- a/mines.c
+++ b/mines.c
@@ -1086,7 +1086,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
* next. Backtrack cursor to the nearest 1,
* change it to a 0 and continue.
*/
- while (cursor-- >= 0 && !setused[cursor]);
+ while (--cursor >= 0 && !setused[cursor]);
if (cursor >= 0) {
assert(setused[cursor]);