From: Simon Tatham Date: Tue, 31 May 2005 17:46:22 +0000 (+0000) Subject: valgrind spotted this array underrun. I wonder if this might have X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=c11f9ff173763e92155838d79a5ea130c5693540;p=sgt-puzzles.git valgrind spotted this array underrun. I wonder if this might have been causing some of Verity's nonreproducible weirdnesses. [originally from svn r5884] --- 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]);