summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2014-03-23 14:55:32 +0000
committerplanetmaker <planetmaker@openttd.org>2014-03-23 14:55:32 +0000
commitcbb971f791ed05dd103f1e142ad8886a6d33cb5e (patch)
tree289cb06cee4e88b9f397d44ebe2e5ad6b6027038
parent53706139242224718a3cbd5f5f1106750a1c4bc1 (diff)
downloadopenttd-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.cpp4
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;