From d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 24 Dec 2015 22:05:48 +0000 Subject: [PATCH] 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. --- flood.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flood.c b/flood.c index bbba915..f97de2f 100644 --- a/flood.c +++ b/flood.c @@ -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. -- 2.30.2