diff options
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 54b925a1b6..6002cbd8e4 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -598,8 +598,12 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { case SCI_OBJ_STRINGS: debugN("Strings\n"); while (script->data [seeker]) { - debugN("%04x: %s\n", seeker, script->data + seeker); - seeker += strlen((char *)script->data + seeker) + 1; + debugN("%04x: %s", seeker, script->data + seeker); + seeker += Common::strnlen((char *)script->data + seeker, script->size - seeker) + 1; + if (seeker > script->size) { + debugN("[TRUNCATED]"); + } + debugN("\n"); } seeker++; // the ending zero byte break; |