aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-24 20:52:35 +0000
committerMartin Kiewitz2010-06-24 20:52:35 +0000
commit35b5da7e0fbc2ee3b3b81c2a0371ac57a00dc856 (patch)
treeff98c281f2827f063374c8a0c3de67737ad6cc59 /engines/sci/engine
parent893429d092cd10a490d14beff74217a6080d1f5a (diff)
downloadscummvm-rg350-35b5da7e0fbc2ee3b3b81c2a0371ac57a00dc856.tar.gz
scummvm-rg350-35b5da7e0fbc2ee3b3b81c2a0371ac57a00dc856.tar.bz2
scummvm-rg350-35b5da7e0fbc2ee3b3b81c2a0371ac57a00dc856.zip
SCI: reverting r50232, didnt make sense. thx @ wjp for noticing
svn-id: r50233
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/seg_manager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 2178b42744..b464438553 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -649,15 +649,14 @@ void SegManager::strncpy(reg_t dest, const char* src, size_t n) {
::strncpy((char *)dest_r.raw, src, n);
} else {
// raw -> non-raw
- uint i;
- for (i = 0; i < n; i++) {
+ for (uint i = 0; i < n; i++) {
setChar(dest_r, i, src[i]);
if (!src[i])
break;
}
// Put an ending NUL to terminate the string
- if ((size_t)dest_r.maxSize > i)
- setChar(dest_r, i, 0);
+ if ((size_t)dest_r.maxSize > n)
+ setChar(dest_r, n, 0);
}
}