From 7c1fb8bee1890f831adde61a98d94a563f9d14fa Mon Sep 17 00:00:00 2001 From: sluicebox Date: Wed, 2 Oct 2019 11:35:34 -0700 Subject: SCI: Return correct value from kFileIOWriteString Fixes corrupt save games in Hoyle5, bug #11174 --- engines/sci/engine/kfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index e3d4fb2afd..156d294ab4 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -757,10 +757,10 @@ reg_t kFileIOWriteString(EngineState *s, int argc, reg_t *argv) { FileHandle *f = getFileFromHandle(s, handle); if (f && f->_out) { - f->_out->write(str.c_str(), str.size()); + uint32 bytesWritten = f->_out->write(str.c_str(), str.size()); if (getSciVersion() <= SCI_VERSION_0_LATE) return s->r_acc; // SCI0 semantics: no value returned - return NULL_REG; + return make_reg(0, bytesWritten); } if (getSciVersion() <= SCI_VERSION_0_LATE) -- cgit v1.2.3