aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-07-03 07:06:48 +0000
committerFilippos Karapetis2009-07-03 07:06:48 +0000
commitf3ac0a62c47c33bfb814c89f52f6c2b50092f561 (patch)
tree7e8c62cba90e09e566e0687c539d20dbee04cb63 /engines/sci
parentd81bbae875ee4ef0681d16dcfd7219da80238df4 (diff)
downloadscummvm-rg350-f3ac0a62c47c33bfb814c89f52f6c2b50092f561.tar.gz
scummvm-rg350-f3ac0a62c47c33bfb814c89f52f6c2b50092f561.tar.bz2
scummvm-rg350-f3ac0a62c47c33bfb814c89f52f6c2b50092f561.zip
Applied patch #2815937 - "SCI: ReadString fix to repair LSL5 password". This fixes the problems with the LSL5 password for good
svn-id: r42049
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kfile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 29c9c5e336..ed18c7fcd6 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -267,6 +267,12 @@ static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) {
return;
}
f->_in->readLine_NEW(dest, maxsize);
+ // The returned string must not have an ending LF
+ int strSize = strlen(dest);
+ if (strSize > 0) {
+ if (dest[strSize - 1] == 0x0A)
+ dest[strSize - 1] = 0;
+ }
debugC(2, kDebugLevelFile, "FGets'ed \"%s\"\n", dest);
}