--- a/os2.c Tue Mar 21 22:06:32 2006 +0000
+++ b/os2.c Tue Mar 21 22:08:15 2006 +0000
@@ -401,7 +401,7 @@
return STR_4006_UNABLE_TO_READ_DRIVE;
}
-void FiosMakeSavegameName(char *buf, const char *name)
+void FiosMakeSavegameName(char *buf, const char *name, size_t size)
{
const char* extension;
const char* period;
@@ -415,14 +415,14 @@
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 unlink(path) == 0;
}