mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
`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]
This commit is contained in:
9
map.c
9
map.c
@ -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);
|
||||
|
Reference in New Issue
Block a user