diff options
| author | Simon Tatham <anakin@pobox.com> | 2015-12-24 22:05:48 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-12-24 22:05:48 +0000 |
| commit | d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97 (patch) | |
| tree | d15801a6a778beb2a67b5396664823007c720230 /flood.c | |
| parent | f1af73319ffceb1b936669182f540454eeb67541 (diff) | |
| download | puzzles-d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97.zip puzzles-d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97.tar.gz puzzles-d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97.tar.bz2 puzzles-d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97.tar.xz | |
Add a missing error message in Flood solve_game().
The only situation in which it actually can't find a solution is if
the puzzle is already solved, in which case it can at least fill in
*error to say so before it returns NULL.
Diffstat (limited to 'flood.c')
| -rw-r--r-- | flood.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -697,8 +697,10 @@ static char *solve_game(const game_state *state, const game_state *currstate, char buf[256]; struct solver_scratch *scratch; - if (currstate->complete) + if (currstate->complete) { + *error = "Puzzle is already solved"; return NULL; + } /* * Find the best solution our solver can give. |