From 5b82822c12e014771dceaf9d909e1c0f3653c5a9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Apr 2014 21:12:09 +0000 Subject: (svn r26486) -Codechange: replace a number of snprintfs with seprintf --- src/os/unix/unix.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/os/unix') 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 @@ -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; -- cgit v1.2.3-70-g09d2