shithub: puzzles

Download patch

ref: c11f9ff173763e92155838d79a5ea130c5693540
parent: 274423eaf868c4fdcff68d4825c8294b5359b170
author: Simon Tatham <anakin@pobox.com>
date: Tue May 31 13:46:22 EDT 2005

valgrind spotted this array underrun. I wonder if this might have
been causing some of Verity's nonreproducible weirdnesses.

[originally from svn r5884]

--- a/mines.c
+++ b/mines.c
@@ -1086,7 +1086,7 @@
 			 * 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]);