From 2ef15f51a7eb043f56d29db74afd3f87a9f19394 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 14 Feb 2007 02:35:48 +0000 Subject: Added guard to prevent crashing if a hospot or character name is needed and was not provided svn-id: r25581 --- engines/lure/strings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/lure/strings.cpp') diff --git a/engines/lure/strings.cpp b/engines/lure/strings.cpp index c9a643a1de..21b61c386e 100644 --- a/engines/lure/strings.cpp +++ b/engines/lure/strings.cpp @@ -277,8 +277,11 @@ void StringData::getString(uint16 stringId, char *dest, const char *hotspotName, // Copy over hotspot or action ch = readCharacter(); const char *p = (ch == '1') ? hotspotName : characterName; - strcpy(destPos, p); - destPos += strlen(p); + if (p != NULL) + { + strcpy(destPos, p); + destPos += strlen(p); + } } else if ((uint8) ch >= 0xa0) { const char *p = getName((uint8) ch - 0xa0); strcpy(destPos, p); -- cgit v1.2.3