(svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay

This commit is contained in:
rubidium
2014-04-23 21:23:21 +00:00
parent 160ad31028
commit 21f991e235
10 changed files with 95 additions and 88 deletions

View File

@@ -116,7 +116,7 @@ bool ScriptInstance::LoadCompatibilityScripts(const char *api_version, Subdirect
char buf[MAX_PATH];
Searchpath sp;
FOR_ALL_SEARCHPATHS(sp) {
FioAppendDirectory(buf, MAX_PATH, sp, dir);
FioAppendDirectory(buf, lastof(buf), sp, dir);
strecat(buf, script_name, lastof(buf));
if (!FileExists(buf)) continue;