[Scummvm-git-logs] scummvm master -> 91bf813e75b38457f8a212021d987d5a784f59f2
sluicebox
22204938+sluicebox at users.noreply.github.com
Sun Nov 7 03:31:47 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
91bf813e75 SCI32: Remove kFileIOReadString warning
Commit: 91bf813e75b38457f8a212021d987d5a784f59f2
https://github.com/scummvm/scummvm/commit/91bf813e75b38457f8a212021d987d5a784f59f2
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-11-06T22:31:19-05:00
Commit Message:
SCI32: Remove kFileIOReadString warning
It's normal for fewer charcters to be available than the maximum buffer
size . Confirmed that nothing depends on not zeroing out the remaining
bytes. (In fact, we've had problems before when not zeroing out buffers
in other kernel functions as scripts have been known to assume success
and use the buffer regardless of the return value.)
Changed paths:
engines/sci/engine/kfile.cpp
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index f6ec127333..9a4d0cdd69 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -721,11 +721,6 @@ reg_t kFileIOReadString(EngineState *s, int argc, reg_t *argv) {
} else if ((int)bytesRead > dest_r.maxSize) {
error("kFileIO(readString) attempting to read %u bytes into buffer of size %u", bytesRead, dest_r.maxSize);
} else if (maxsize > dest_r.maxSize) {
- // This happens at least in the QfG4 character import.
- // CHECKME: We zero the remainder of the dest buffer, while
- // at least several (and maybe all) SSCI interpreters didn't do this.
- // Therefore this warning is presumably no problem.
- warning("kFileIO(readString) attempting to copy %u bytes into buffer of size %u (%u/%u bytes actually read)", maxsize, dest_r.maxSize, bytesRead, maxsize);
maxsize = dest_r.maxSize;
}
More information about the Scummvm-git-logs
mailing list