(svn r7280) -Codechange: Replace some sprintf() functions with the safer snprintf() functions

This commit is contained in:
Darkvater
2006-11-28 20:55:16 +00:00
parent ea965a4adf
commit b9eed21679
8 changed files with 21 additions and 20 deletions

View File

@@ -117,7 +117,7 @@ FILE *FioFOpenFile(const char *filename)
FILE *f;
char buf[MAX_PATH];
sprintf(buf, "%s%s", _path.data_dir, filename);
snprintf(buf, lengthof(buf), "%s%s", _path.data_dir, filename);
f = fopen(buf, "rb");
#if !defined(WIN32)
@@ -128,7 +128,7 @@ FILE *FioFOpenFile(const char *filename)
#if defined SECOND_DATA_DIR
// tries in the 2nd data directory
if (f == NULL) {
sprintf(buf, "%s%s", _path.second_data_dir, filename);
snprintf(buf, lengthof(buf), "%s%s", _path.second_data_dir, filename);
strtolower(buf + strlen(_path.second_data_dir) - 1);
f = fopen(buf, "rb");
}