From ce0613932861cbce673bcd153a0004fd9e1d288c Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Apr 2014 21:30:32 +0000 Subject: (svn r26490) -Fix (r26489): compilation under Windows --- src/os/windows/win32.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index 66d7207df..011c8e53c 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -212,7 +212,7 @@ void FiosGetDrives() FiosItem *fios = _fios_items.Append(); fios->type = FIOS_TYPE_DRIVE; fios->mtime = 0; - snprintf(fios->name, lengthof(fios->name), PATHSEP ""); + seprintf(fios->name, lastof(fios->name), PATHSEP ""); strecpy(fios->title, fios->name, lastof(fios->title)); #else TCHAR drives[256]; @@ -223,7 +223,7 @@ void FiosGetDrives() FiosItem *fios = _fios_items.Append(); fios->type = FIOS_TYPE_DRIVE; fios->mtime = 0; - snprintf(fios->name, lengthof(fios->name), "%c:", s[0] & 0xFF); + seprintf(fios->name, lastof(fios->name), "%c:", s[0] & 0xFF); strecpy(fios->title, fios->name, lastof(fios->title)); while (*s++ != '\0') { /* Nothing */ } } @@ -495,9 +495,9 @@ void DetermineBasePaths(const char *exe) #ifdef WITH_PERSONAL_DIR if (SUCCEEDED(OTTDSHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path))) { strecpy(tmp, FS2OTTD(path), lastof(tmp)); - AppendPathSeparator(tmp, MAX_PATH); + AppendPathSeparator(tmp, lastof(tmp)); strecat(tmp, PERSONAL_DIR, lastof(tmp)); - AppendPathSeparator(tmp, MAX_PATH); + AppendPathSeparator(tmp, lastof(tmp)); _searchpaths[SP_PERSONAL_DIR] = strdup(tmp); } else { _searchpaths[SP_PERSONAL_DIR] = NULL; @@ -505,9 +505,9 @@ void DetermineBasePaths(const char *exe) if (SUCCEEDED(OTTDSHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, path))) { strecpy(tmp, FS2OTTD(path), lastof(tmp)); - AppendPathSeparator(tmp, MAX_PATH); + AppendPathSeparator(tmp, lastof(tmp)); strecat(tmp, PERSONAL_DIR, lastof(tmp)); - AppendPathSeparator(tmp, MAX_PATH); + AppendPathSeparator(tmp, lastof(tmp)); _searchpaths[SP_SHARED_DIR] = strdup(tmp); } else { _searchpaths[SP_SHARED_DIR] = NULL; @@ -519,7 +519,7 @@ void DetermineBasePaths(const char *exe) /* Get the path to working directory of OpenTTD */ getcwd(tmp, lengthof(tmp)); - AppendPathSeparator(tmp, MAX_PATH); + AppendPathSeparator(tmp, lastof(tmp)); _searchpaths[SP_WORKING_DIR] = strdup(tmp); if (!GetModuleFileName(NULL, path, lengthof(path))) { -- cgit v1.2.3-54-g00ecf