diff options
-rw-r--r-- | engines/kyra/text.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index 61073b5cfc..c8c4657a36 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -420,8 +420,10 @@ int TextDisplayer::dropCRIntoString(char *str, int offs) { char *TextDisplayer::preprocessString(const char *str) { debugC(9, kDebugLevelMain, "TextDisplayer::preprocessString('%s')", str); - assert(strlen(str) < sizeof(_talkBuffer) - 1); - strcpy(_talkBuffer, str); + if (str != _talkBuffer) { + assert(strlen(str) < sizeof(_talkBuffer) - 1); + strcpy(_talkBuffer, str); + } char *p = _talkBuffer; while (*p) { if (*p == '\r') { |