diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-08-22 09:27:52 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-08-22 09:27:52 +0000 |
| commit | b0614e6da8f8a709e8fad797d7bb6ba05491ac79 (patch) | |
| tree | 3eedf82984c90cc6b48189e9fd6455b98f2836e6 | |
| parent | cd76bfb25f68bb320587bf85a059ee83c3d05239 (diff) | |
| download | puzzles-b0614e6da8f8a709e8fad797d7bb6ba05491ac79.zip puzzles-b0614e6da8f8a709e8fad797d7bb6ba05491ac79.tar.gz puzzles-b0614e6da8f8a709e8fad797d7bb6ba05491ac79.tar.bz2 puzzles-b0614e6da8f8a709e8fad797d7bb6ba05491ac79.tar.xz | |
`Solve' operation on an already solved map without an aux_info was
returning NULL due to no moves being required, leading to a strange
error message. Trivial fix.
[originally from svn r6198]
| -rw-r--r-- | map.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1563,8 +1563,10 @@ static char *solve_game(game_state *state, game_state *currstate, return NULL; } - retlen = retsize = 0; - ret = NULL; + retsize = 64; + ret = snewn(retsize, char); + strcpy(ret, "S"); + retlen = 1; for (i = 0; i < state->map->n; i++) { int len; @@ -1574,8 +1576,7 @@ static char *solve_game(game_state *state, game_state *currstate, continue; assert(!state->map->immutable[i]); - len = sprintf(buf, "%s%d:%d", retlen ? ";" : "S;", - colouring[i], i); + len = sprintf(buf, ";%d:%d", colouring[i], i); if (retlen + len >= retsize) { retsize = retlen + len + 256; ret = sresize(ret, retsize, char); |