Don't sprintf into filename var.
This commit is contained in:
parent
ead0c5335a
commit
c91aac41fe
|
@ -455,15 +455,14 @@ void restoreGameState(void)
|
||||||
|
|
||||||
char *getSaveWidgetLabel(char *filename)
|
char *getSaveWidgetLabel(char *filename)
|
||||||
{
|
{
|
||||||
static char label[MAX_PATH_LENGTH];
|
static char label[MAX_NAME_LENGTH];
|
||||||
|
|
||||||
cJSON *root, *statsJSON;
|
cJSON *root, *statsJSON;
|
||||||
char *text, *statName;
|
char *text, *statName;
|
||||||
int i, gameDone, gameTotal, stats[STAT_MAX];
|
int i, gameDone, gameTotal, stats[STAT_MAX];
|
||||||
|
|
||||||
strcpy(label, "");
|
strcpy(label, "");
|
||||||
|
|
||||||
sprintf(filename, "%s/%d/game.json", app.saveDir, game.saveSlot);
|
|
||||||
|
|
||||||
text = readFile(filename);
|
text = readFile(filename);
|
||||||
|
|
||||||
root = cJSON_Parse(text);
|
root = cJSON_Parse(text);
|
||||||
|
|
Loading…
Reference in New Issue