diff options
author | Martin Kiewitz | 2010-06-24 20:52:35 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-24 20:52:35 +0000 |
commit | 35b5da7e0fbc2ee3b3b81c2a0371ac57a00dc856 (patch) | |
tree | ff98c281f2827f063374c8a0c3de67737ad6cc59 /engines/sci/engine | |
parent | 893429d092cd10a490d14beff74217a6080d1f5a (diff) | |
download | scummvm-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.cpp | 7 |
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); } } |