diff options
author | rubidium <rubidium@openttd.org> | 2008-05-04 21:47:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-04 21:47:36 +0000 |
commit | 0b8b5d1f3b5f45374d1e43390777b2de51fb7728 (patch) | |
tree | 29ce52a6dd43a3d20ec100ca5f266897cadc57fd | |
parent | 762315c47cd539dc5a7288803ad4d6dd613e17b8 (diff) | |
download | openttd-0b8b5d1f3b5f45374d1e43390777b2de51fb7728.tar.xz |
(svn r12943) -Fix: reading/modifying invalid data under some circumstances.
-rw-r--r-- | src/fileio.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp index 09329b84f..c6eb90ca9 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -315,7 +315,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd f = fopen(buf, mode); #if !defined(WIN32) if (f == NULL) { - strtolower(buf + strlen(_searchpaths[sp]) - 1); + strtolower(buf + ((subdir == NO_DIRECTORY) ? 0 : strlen(_searchpaths[sp]) - 1)); f = fopen(buf, mode); } #endif |