diff options
author | sluicebox | 2019-10-02 11:35:34 -0700 |
---|---|---|
committer | sluicebox | 2019-10-02 11:35:34 -0700 |
commit | 7c1fb8bee1890f831adde61a98d94a563f9d14fa (patch) | |
tree | 73918ddd7c3771bb9142643d1e57a14685e58298 /engines | |
parent | 2ab281ffa1b2e91dd157158bddb1ceed3672aad5 (diff) | |
download | scummvm-rg350-7c1fb8bee1890f831adde61a98d94a563f9d14fa.tar.gz scummvm-rg350-7c1fb8bee1890f831adde61a98d94a563f9d14fa.tar.bz2 scummvm-rg350-7c1fb8bee1890f831adde61a98d94a563f9d14fa.zip |
SCI: Return correct value from kFileIOWriteString
Fixes corrupt save games in Hoyle5, bug #11174
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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) |