summaryrefslogtreecommitdiff
path: root/src/fios.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-28 16:04:41 +0000
committerrubidium <rubidium@openttd.org>2008-10-28 16:04:41 +0000
commit633b15caf3f616f7778ca153573097fcb7fdfad0 (patch)
tree815e6926a369936b4b60e6dd6c09707094a4a426 /src/fios.cpp
parentda0a0ef8ca740e9d23b71a1b02c4fc0c7512eaec (diff)
downloadopenttd-633b15caf3f616f7778ca153573097fcb7fdfad0.tar.xz
(svn r14542) -Codechange: replace some sprintf with s[en]printf to make sure they will not overflow their buffers.
Diffstat (limited to 'src/fios.cpp')
-rw-r--r--src/fios.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index 116179228..aa2ecf236 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -95,9 +95,9 @@ char *FiosBrowseTo(const FiosItem *item)
switch (item->type) {
case FIOS_TYPE_DRIVE:
#if defined(WINCE)
- sprintf(path, PATHSEP "");
+ snprintf(path, MAX_PATH, PATHSEP "");
#elif defined(WIN32) || defined(__OS2__)
- sprintf(path, "%c:" PATHSEP, item->title[0]);
+ snprintf(path, MAX_PATH, "%c:" PATHSEP, item->title[0]);
#endif
/* Fallthrough */
case FIOS_TYPE_INVALID:
@@ -124,7 +124,7 @@ char *FiosBrowseTo(const FiosItem *item)
break;
case FIOS_TYPE_DIRECT:
- sprintf(path, "%s", item->name);
+ snprintf(path, MAX_PATH, "%s", item->name);
break;
case FIOS_TYPE_FILE: