Don't sprintf into filename var.

This commit is contained in:
Steve 2018-04-21 10:41:36 +01:00
parent ead0c5335a
commit c91aac41fe
1 changed files with 2 additions and 3 deletions

View File

@ -455,15 +455,14 @@ void restoreGameState(void)
char *getSaveWidgetLabel(char *filename)
{
static char label[MAX_PATH_LENGTH];
static char label[MAX_NAME_LENGTH];
cJSON *root, *statsJSON;
char *text, *statName;
int i, gameDone, gameTotal, stats[STAT_MAX];
strcpy(label, "");
sprintf(filename, "%s/%d/game.json", app.saveDir, game.saveSlot);
text = readFile(filename);
root = cJSON_Parse(text);