diff options
author | Darkvater <darkvater@openttd.org> | 2006-11-28 20:55:16 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-11-28 20:55:16 +0000 |
commit | 7c945bf8283d381ebf7982377b639f163f23a1ea (patch) | |
tree | 5c4e14a6ee9c764ba23ada2a4c72dcc0ade951c2 /fileio.c | |
parent | dcbbda0cb9674e8fc9aaa64a0861fd6381ae4202 (diff) | |
download | openttd-7c945bf8283d381ebf7982377b639f163f23a1ea.tar.xz |
(svn r7280) -Codechange: Replace some sprintf() functions with the safer snprintf() functions
Diffstat (limited to 'fileio.c')
-rw-r--r-- | fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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"); } |