From 15974d06bbaad287382c6eeb8deb7c6f3a627278 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 9 Jan 2023 15:07:24 +0000 Subject: [PATCH] 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.". --- towers.c | 1 + 1 file changed, 1 insertion(+) 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; }