diff options
author | planetmaker <planetmaker@openttd.org> | 2014-03-23 14:55:32 +0000 |
---|---|---|
committer | planetmaker <planetmaker@openttd.org> | 2014-03-23 14:55:32 +0000 |
commit | cbb971f791ed05dd103f1e142ad8886a6d33cb5e (patch) | |
tree | 289cb06cee4e88b9f397d44ebe2e5ad6b6027038 | |
parent | 53706139242224718a3cbd5f5f1106750a1c4bc1 (diff) | |
download | openttd-cbb971f791ed05dd103f1e142ad8886a6d33cb5e.tar.xz |
(svn r26423) -Fix: Don't crash when supplying an invalid filename without extension to cmd parameter -q
-rw-r--r-- | src/fios.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fios.cpp b/src/fios.cpp index b2ed1ec50..ff7153af3 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -400,6 +400,10 @@ FiosType FiosGetSavegameListCallback(SaveLoadDialogMode mode, const char *file, * .SS1 Transport Tycoon Deluxe preset game * .SV1 Transport Tycoon Deluxe (Patch) saved game * .SV2 Transport Tycoon Deluxe (Patch) saved 2-player game */ + + /* Don't crash if we supply no extension */ + if (ext == NULL) return FIOS_TYPE_INVALID; + if (strcasecmp(ext, ".sav") == 0) { GetFileTitle(file, title, last, SAVE_DIR); return FIOS_TYPE_FILE; |