chiark / gitweb /
Bug fix from James H: solve_game() was returning error messages in
authorSimon Tatham <anakin@pobox.com>
Thu, 4 Aug 2005 17:07:51 +0000 (17:07 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 4 Aug 2005 17:07:51 +0000 (17:07 +0000)
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]

slant.c

diff --git a/slant.c b/slant.c
index 06c1f51c15d9080b27d9773cd7d3ab07e0bd5d81..13100187b59255ca3ced439b21606e08536baefe 100644 (file)
--- a/slant.c
+++ b/slant.c
@@ -734,9 +734,10 @@ static char *solve_game(game_state *state, game_state *currstate,
        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;
     }