`trophyId` fix

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_".
This commit is contained in:
oglinuk 2021-12-06 12:12:55 -08:00
parent 40cb97049c
commit 793b1b95a8
1 changed files with 2 additions and 1 deletions

View File

@ -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;