mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 20:59:00 +00:00
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
@ -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…
x
Reference in New Issue
Block a user