diff options
author | Max Horn | 2007-01-21 15:19:30 +0000 |
---|---|---|
committer | Max Horn | 2007-01-21 15:19:30 +0000 |
commit | fef501c20509d7a74f4ee53abd2557be533c75e7 (patch) | |
tree | 28c28da5695bf1432e8f76d3fb029729e3e0f9b6 /engines | |
parent | aaf706a43df127b4134c23313f02177525f86e78 (diff) | |
download | scummvm-rg350-fef501c20509d7a74f4ee53abd2557be533c75e7.tar.gz scummvm-rg350-fef501c20509d7a74f4ee53abd2557be533c75e7.tar.bz2 scummvm-rg350-fef501c20509d7a74f4ee53abd2557be533c75e7.zip |
openForSaving can fail, so it should be handled gracefully -- but better to assert out in a controlled manner than o invoke methods on a NULL pointer, right? :-)
svn-id: r25151
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/various.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/loadsave.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index d75a2e0f4a..d6805c2ec4 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -1022,6 +1022,9 @@ void CineEngine::makeSystemMenu(void) { snprintf(tmp, 80, "%s.dir", _targetName.c_str()); fHandle = g_saveFileMan->openForSaving(tmp); + // FIXME: Properly handle openForSaving failures instead of + // just crashing silently! + assert(fHandle); fHandle->write(currentSaveName, 200); delete fHandle; diff --git a/engines/parallaction/loadsave.cpp b/engines/parallaction/loadsave.cpp index 2cfa7c388e..e151e220ec 100644 --- a/engines/parallaction/loadsave.cpp +++ b/engines/parallaction/loadsave.cpp @@ -157,6 +157,9 @@ void Parallaction::doSaveGame(uint16 _di) { sprintf(path, "game.%d", _di); Common::OutSaveFile *f = _saveFileMan->openForSaving(path); + // FIXME: Properly handle openForSaving failures instead of + // just crashing silently! + assert(f); char s[30]; |