shithub: puzzles

Download patch

ref: 2e214d740cc9ea2c8061713b0d944f1f29374206
parent: e55838bc9b0d173ca539d0cfe714495b5c12b9dd
author: Simon Tatham <anakin@pobox.com>
date: Thu Aug 4 13:07:51 EDT 2005

Bug fix from James H: solve_game() was returning error messages in
the return value rather than in *error. In the old days type-
checking would have caught this, but now of course they're the same
type.

[originally from svn r6161]

--- a/slant.c
+++ b/slant.c
@@ -734,9 +734,10 @@
 	if (ret != 1) {
 	    sfree(soln);
 	    if (ret == 0)
-		return "This puzzle is not self-consistent";
+		*error = "This puzzle is not self-consistent";
 	    else
-		return "Unable to find a unique solution for this puzzle";
+		*error = "Unable to find a unique solution for this puzzle";
+            return NULL;
 	}
 	free_soln = TRUE;
     }