aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-03 21:27:01 +0000
committerWillem Jan Palenstijn2009-10-03 21:27:01 +0000
commit75de46e9ab69d189e2831bdd3a6af2a1d27de15a (patch)
tree7eb71fcea5bf2d32d664ab6004fe33f6d656db34 /engines/sci
parentcfb7632a770d077adeed2494e7f6d23c65e9186d (diff)
downloadscummvm-rg350-75de46e9ab69d189e2831bdd3a6af2a1d27de15a.tar.gz
scummvm-rg350-75de46e9ab69d189e2831bdd3a6af2a1d27de15a.tar.bz2
scummvm-rg350-75de46e9ab69d189e2831bdd3a6af2a1d27de15a.zip
SCI: Fix sign issue in stringfrags
svn-id: r44572
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/seg_manager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 4e770d26d7..43c48e3988 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -891,10 +891,10 @@ void SegManager::strncpy(reg_t dest, const char* src, size_t n) {
while (n > 0) {
d->segment = 0; // STRINGFRAG_SEGMENT?
if (n > 1 && src[0]) {
- d->offset = src[0] | (src[1] << 8);
+ d->offset = (src[0] & 0x00ff) | (src[1] << 8);
} else {
d->offset &= 0xff00;
- d->offset |= src[0];
+ d->offset |= src[0] & 0x00ff;
break;
}
@@ -994,10 +994,10 @@ void SegManager::memcpy(reg_t dest, const byte* src, size_t n) {
while (n > 0) {
d->segment = 0; // STRINGFRAG_SEGMENT?
if (n > 1) {
- d->offset = src[0] | (src[1] << 8);
+ d->offset = (src[0] & 0x00ff) | (src[1] << 8);
} else {
d->offset &= 0xff00;
- d->offset |= src[0];
+ d->offset |= src[0] & 0x00ff;
break;
}
src += 2;