aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2010-08-22 03:50:42 +0000
committerMatthew Hoops2010-08-22 03:50:42 +0000
commit3677a8a382d0a0c551f8ef075164bc0b765d2bca (patch)
treefafefc99afce8a596f629a7caa12f552b965fb62
parentc8a9eb9c3211fd9e2343d4759a25386658670d82 (diff)
downloadscummvm-rg350-3677a8a382d0a0c551f8ef075164bc0b765d2bca.tar.gz
scummvm-rg350-3677a8a382d0a0c551f8ef075164bc0b765d2bca.tar.bz2
scummvm-rg350-3677a8a382d0a0c551f8ef075164bc0b765d2bca.zip
SCI: Fix a bug in kFileIOWriteString. The first return statement should go inside the if-statement.
svn-id: r52269
-rw-r--r--engines/sci/engine/kfile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index a9bdac103b..5a38e16dff 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -853,9 +853,12 @@ reg_t kFileIOWriteString(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelFile, "kFileIO(writeString): %d", handle);
FileHandle *f = getFileFromHandle(s, handle);
- if (f)
+
+ if (f) {
f->_out->write(str.c_str(), str.size());
return NULL_REG;
+ }
+
return make_reg(0, 6); // DOS - invalid handle
}
@@ -866,8 +869,10 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence);
FileHandle *f = getFileFromHandle(s, handle);
+
if (f)
s->r_acc = make_reg(0, f->_in->seek(offset, whence));
+
return SIGNAL_REG;
}