aboutsummaryrefslogtreecommitdiff
path: root/towers.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-09 15:07:24 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-15 16:24:27 +0000
commit15974d06bbaad287382c6eeb8deb7c6f3a627278 (patch)
treecc1943ead261077a93e25f32a2e4f6c89fec3d5b /towers.c
parent5bd02f982a878312065b4d81d05a90bc41a98c6c (diff)
downloadpuzzles-15974d06bbaad287382c6eeb8deb7c6f3a627278.zip
puzzles-15974d06bbaad287382c6eeb8deb7c6f3a627278.tar.gz
puzzles-15974d06bbaad287382c6eeb8deb7c6f3a627278.tar.bz2
puzzles-15974d06bbaad287382c6eeb8deb7c6f3a627278.tar.xz
Towers: reject descriptions with odd characters at the end
Towers' new_game() causes an assertion failure on game description strings that contain spurious characters after a valid description, so validate_desc() should also refuse such a description. The problem could be demonstrated by editing the game description in the "Specific" dialogue box to add a '!' at the end, which caused "new_game: Assertion `!*p' failed.".
Diffstat (limited to 'towers.c')
-rw-r--r--towers.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/towers.c b/towers.c
index e0dad48..661514c 100644
--- a/towers.c
+++ b/towers.c
@@ -893,6 +893,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
return "Too much data to fit in grid";
}
+ if (*p) return "Rubbish at end of game description";
return NULL;
}