diff options
Diffstat (limited to 'win32.c')
-rw-r--r-- | win32.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -963,7 +963,7 @@ StringID FiosGetDescText(const char **path, uint32 *tot) return sid; } -void FiosMakeSavegameName(char *buf, const char *name) +void FiosMakeSavegameName(char *buf, const char *name, size_t size) { const char* extension; const char* period; @@ -977,14 +977,14 @@ void FiosMakeSavegameName(char *buf, const char *name) period = strrchr(name, '.'); if (period != NULL && strcasecmp(period, extension) == 0) extension = ""; - sprintf(buf, "%s\\%s%s", _fios_path, name, extension); + snprintf(buf, size, "%s\\%s%s", _fios_path, name, extension); } bool FiosDelete(const char *name) { char path[512]; - snprintf(path, lengthof(path), "%s\\%s", _fios_path, name); + FiosMakeSavegameName(path, name, sizeof(path)); return DeleteFile(path) != 0; } |