aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/support/simple_file.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 65d2c85273..103f062ac6 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -424,8 +424,10 @@ bool SimpleFile::scanf(const char *format, ...) {
formatStr.deleteChar(0);
safeRead(&c, 1);
- if (!Common::isSpace(c))
+ if (!Common::isSpace(c)) {
+ va_end(va);
return false;
+ }
// Skip over whitespaces
skipSpaces();