summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-23 21:12:09 +0000
committerrubidium <rubidium@openttd.org>2014-04-23 21:12:09 +0000
commit5b82822c12e014771dceaf9d909e1c0f3653c5a9 (patch)
tree1cf02e076eb61eb94d9064c7cb02bbe85ecb9a6c /src/os
parentef4c2ce0317ae583e837722b6a41ea44cd83da71 (diff)
downloadopenttd-5b82822c12e014771dceaf9d909e1c0f3653c5a9.tar.xz
(svn r26486) -Codechange: replace a number of snprintfs with seprintf
Diffstat (limited to 'src/os')
-rw-r--r--src/os/unix/unix.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/os/unix/unix.cpp b/src/os/unix/unix.cpp
index ddbf0fe36..4020aeba2 100644
--- a/src/os/unix/unix.cpp
+++ b/src/os/unix/unix.cpp
@@ -15,6 +15,7 @@
#include "../../crashlog.h"
#include "../../core/random_func.hpp"
#include "../../debug.h"
+#include "../../string_func.h"
#include <dirent.h>
@@ -107,13 +108,13 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb
#if defined(__MORPHOS__) || defined(__AMIGAOS__)
/* On MorphOS or AmigaOS paths look like: "Volume:directory/subdirectory" */
if (FiosIsRoot(path)) {
- res = snprintf(filename, lengthof(filename), "%s:%s", path, ent->d_name);
+ res = seprintf(filename, lastof(filename), "%s:%s", path, ent->d_name);
} else // XXX - only next line!
#else
assert(path[strlen(path) - 1] == PATHSEPCHAR);
if (strlen(path) > 2) assert(path[strlen(path) - 2] != PATHSEPCHAR);
#endif
- res = snprintf(filename, lengthof(filename), "%s%s", path, ent->d_name);
+ res = seprintf(filename, lastof(filename), "%s%s", path, ent->d_name);
/* Could we fully concatenate the path and filename? */
if (res >= (int)lengthof(filename) || res < 0) return false;