SCI: clear strcpy's dest string if src is invalid.
This fixes moving the plank at the start of KQ6 in Text mode. svn-id: r44397
This commit is contained in:
parent
77751a0455
commit
08e4d96a7d
1 changed files with 4 additions and 0 deletions
|
@ -912,6 +912,10 @@ void SegManager::strncpy(reg_t dest, reg_t src, size_t n) {
|
|||
const SegmentRef src_r = dereference(src);
|
||||
if (!src_r.isValid()) {
|
||||
warning("Attempt to strncpy from invalid pointer %04x:%04x", PRINT_REG(src));
|
||||
|
||||
// Clear target string instead.
|
||||
if (n > 0)
|
||||
strcpy(dest, "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue