diff options
-rw-r--r-- | engines/hugo/file.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp index 172b1687cb..150ad2d2b8 100644 --- a/engines/hugo/file.cpp +++ b/engines/hugo/file.cpp @@ -826,8 +826,12 @@ void FileManager::readConfig() { sprintf(path, "%s%s", _vm.getGameStatus().path, CONFIGFILE); if (f.open(path)) { // If config format changed, ignore it and use defaults - if (f.read(&_config, sizeof(_config)) != sizeof(_config)) - _config = tmpConfig; + if (f.size() != sizeof(_config)) { + warning("Incompatible %s: file size:%d expected size: %d. Skipping loading.", CONFIGFILE, f.size(), sizeof(_config)); + } else { + if (f.read(&_config, sizeof(_config)) != sizeof(_config)) + _config = tmpConfig; + } f.close(); } |