diff options
author | skidd13 <skidd13@openttd.org> | 2008-11-02 11:20:15 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2008-11-02 11:20:15 +0000 |
commit | 706dd0f86c2453eadb44742ca62d6c5d690e9238 (patch) | |
tree | 852231dcb9853107b3876ca33a89cbeb47f20133 /src/fios.cpp | |
parent | c03e55b32a4b9bf64c516d38ce75ff5c8ab39748 (diff) | |
download | openttd-706dd0f86c2453eadb44742ca62d6c5d690e9238.tar.xz |
(svn r14555) -Codechange: replace ttd_strlcat and ttd_strlcpy with strecat and strecpy where direct conversion is possible
Diffstat (limited to 'src/fios.cpp')
-rw-r--r-- | src/fios.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fios.cpp b/src/fios.cpp index aa2ecf236..6827f37aa 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -216,14 +216,14 @@ static FiosItem *FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_ fios = _fios_items.Append(); fios->type = FIOS_TYPE_PARENT; fios->mtime = 0; - ttd_strlcpy(fios->name, "..", lengthof(fios->name)); - ttd_strlcpy(fios->title, ".. (Parent directory)", lengthof(fios->title)); + strecpy(fios->name, "..", lastof(fios->name)); + strecpy(fios->title, ".. (Parent directory)", lastof(fios->title)); } /* Show subdirectories */ if (mode != SLD_NEW_GAME && (dir = ttd_opendir(_fios_path)) != NULL) { while ((dirent = readdir(dir)) != NULL) { - ttd_strlcpy(d_name, FS2OTTD(dirent->d_name), sizeof(d_name)); + strecpy(d_name, FS2OTTD(dirent->d_name), lastof(d_name)); /* found file must be directory, but not '.' or '..' */ if (FiosIsValidFile(_fios_path, dirent, &sb) && (sb.st_mode & S_IFDIR) && @@ -232,7 +232,7 @@ static FiosItem *FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_ fios = _fios_items.Append(); fios->type = FIOS_TYPE_DIR; fios->mtime = 0; - ttd_strlcpy(fios->name, d_name, lengthof(fios->name)); + strecpy(fios->name, d_name, lastof(fios->name)); snprintf(fios->title, lengthof(fios->title), "%s" PATHSEP " (Directory)", d_name); str_validate(fios->title); } @@ -257,7 +257,7 @@ static FiosItem *FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_ while ((dirent = readdir(dir)) != NULL) { char fios_title[64]; char *t; - ttd_strlcpy(d_name, FS2OTTD(dirent->d_name), sizeof(d_name)); + strecpy(d_name, FS2OTTD(dirent->d_name), lastof(d_name)); if (!FiosIsValidFile(_fios_path, dirent, &sb) || !(sb.st_mode & S_IFREG) || FiosIsHiddenFile(dirent)) continue; @@ -270,12 +270,12 @@ static FiosItem *FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_ fios = _fios_items.Append(); fios->mtime = sb.st_mtime; fios->type = type; - ttd_strlcpy(fios->name, d_name, lengthof(fios->name)); + strecpy(fios->name, d_name, lastof(fios->name)); /* Some callbacks want to lookup the title of the file. Allow that. * If we just copy the title from the filename, strip the extension */ t = (fios_title[0] == '\0') ? *t = '\0', d_name : fios_title; - ttd_strlcpy(fios->title, t, lengthof(fios->title)); + strecpy(fios->title, t, lastof(fios->title)); str_validate(fios->title); } } |