From 3677a8a382d0a0c551f8ef075164bc0b765d2bca Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 22 Aug 2010 03:50:42 +0000 Subject: SCI: Fix a bug in kFileIOWriteString. The first return statement should go inside the if-statement. svn-id: r52269 --- engines/sci/engine/kfile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3