SCI: reverting r50232, didnt make sense. thx @ wjp for noticing

svn-id: r50233
This commit is contained in:
Martin Kiewitz 2010-06-24 20:52:35 +00:00
parent 893429d092
commit 35b5da7e0f

View File

@ -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);
}
}