aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-09-26 23:43:45 +0000
committerWillem Jan Palenstijn2009-09-26 23:43:45 +0000
commitf7d7140876a3f516025f3e54f63696f49f44e5ee (patch)
tree96c466418ceb8de1da8f4e0fd5beb51b42ba1bc2 /engines
parentc12a78eaa8792ce5a499eda46e13809275603c03 (diff)
downloadscummvm-rg350-f7d7140876a3f516025f3e54f63696f49f44e5ee.tar.gz
scummvm-rg350-f7d7140876a3f516025f3e54f63696f49f44e5ee.tar.bz2
scummvm-rg350-f7d7140876a3f516025f3e54f63696f49f44e5ee.zip
SCI: Ignore size argument to FILEIO_WRITE_STRING.
This matches LSL5's expectations when saving the password. svn-id: r44385
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kfile.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 53c28d2258..372e7b8aa9 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -233,7 +233,7 @@ reg_t kFClose(EngineState *s, int, int argc, reg_t *argv) {
return s->r_acc;
}
-void fwrite_wrapper(EngineState *s, int handle, char *data, int length) {
+void fwrite_wrapper(EngineState *s, int handle, const char *data, int length) {
debugC(2, kDebugLevelFile, "fwrite()'ing \"%s\" to handle %d\n", data, handle);
FileHandle *f = getFileFromHandle(s, handle);
@@ -808,15 +808,14 @@ reg_t kFileIO(EngineState *s, int, int argc, reg_t *argv) {
case K_FILEIO_WRITE_STRING : {
int handle = argv[1].toUint16();
int size = argv[3].toUint16();
- char *buf = s->segMan->derefString(argv[2], size);
+ char *buf = s->segMan->derefString(argv[2]);
debug(3, "K_FILEIO_WRITE_STRING(%d,%d)", handle, size);
- // FIXME: What is the difference between K_FILEIO_WRITE_STRING and
- // K_FILEIO_WRITE_RAW? Normally, I would expect the difference to
- // be that the former doesn't receive a 'size' parameter. But here
- // it does. Are we missing something?
- if (buf)
- fwrite_wrapper(s, handle, buf, size);
+ // CHECKME: Is the size parameter used at all?
+ // In the LSL5 password protection it is zero, and we should
+ // then write a full string. (Not sure if it should write the
+ // terminating zero.)
+ fwrite_wrapper(s, handle, buf, strlen(buf));
break;
}
case K_FILEIO_SEEK : {