simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Fri Dec 19 10:03:39 GMT 2025
TL;DR:
c84b4a1 Mosaic: fix some memory leaks in new_game_desc.
ecb576f Mosaic: don't emit invalid '}' in game descriptions.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2025-12-19 10:03:39
commit c84b4a18aaef96c5ddf8eaf7036f8aa925c27dda
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c84b4a18aaef96c5ddf8eaf7036f8aa925c27dda;hp=5c2f87c9d6fb3ef173f1882001e7020069943a12
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Dec 19 09:42:55 2025 +0000
Mosaic: fix some memory leaks in new_game_desc.
Found in passing while attempting to debug something else.
mosaic.c | 3 +++
1 file changed, 3 insertions(+)
commit ecb576fb2a0a47df6486919c1ebb945f7f252234
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ecb576fb2a0a47df6486919c1ebb945f7f252234;hp=c84b4a18aaef96c5ddf8eaf7036f8aa925c27dda
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Dec 19 09:49:48 2025 +0000
Mosaic: don't emit invalid '}' in game descriptions.
If a game description involved a run of 27 clue-free cells, then the
game would accidentally emit '}', obtained by incrementing the 'z' for
a 26-space run one more time, due to an off-by-one error. Not only
that, but the grid would be incorrectly encoded even if you did
interpret '}' as a 27-space run, because that character was emitted
_instead_ of incrementing the count, not as well.
Now a run of 27 spaces is emitted as 'za', and 28 as 'zb', as it
should be.
A particular game seed which ran into this was 50x50h0#524000234917895
which produced a game description string that validate_desc wouldn't
accept. Worse, if you entered that seed live, so that the string
didn't go through validate_desc at all, then it would be mis-decoded,
moving some 7 clues on to the left margin where they're obviously
unsatisfiable.
mosaic.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
More information about the tartarus-commits
mailing list