From 793b1b95a8e185a475288c277ae2a063734135b5 Mon Sep 17 00:00:00 2001 From: oglinuk Date: Mon, 6 Dec 2021 12:12:55 -0800 Subject: [PATCH] `trophyId` fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling, it would throw `src/game/trophies.c:455:32: error: ā€˜%sā€™ directive writing up to 31 bytes into a region of size 23`. Fixed by adding 9 to `MAX_NAME_LENGTH` to account for "CAMPAIGN_". --- src/game/trophies.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/trophies.c b/src/game/trophies.c index 0e802e0..eb58377 100644 --- a/src/game/trophies.c +++ b/src/game/trophies.c @@ -426,7 +426,8 @@ void awardStatsTrophies(void) void awardCampaignTrophies(void) { - char trophyId[MAX_NAME_LENGTH]; + /* add 9 to MAX_NAME_LENGTH to account for "CAMPAIGN_" */ + char trophyId[MAX_NAME_LENGTH+9]; char name[MAX_NAME_LENGTH]; int i, len; StarSystem *starSystem;