aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/strings.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2007-02-14 02:35:48 +0000
committerPaul Gilbert2007-02-14 02:35:48 +0000
commit2ef15f51a7eb043f56d29db74afd3f87a9f19394 (patch)
tree790851035b1273de3ddb1d9e1206b8a601e3540f /engines/lure/strings.cpp
parent42631d21b19246504588a6b3a06cd8d1f5629e49 (diff)
downloadscummvm-rg350-2ef15f51a7eb043f56d29db74afd3f87a9f19394.tar.gz
scummvm-rg350-2ef15f51a7eb043f56d29db74afd3f87a9f19394.tar.bz2
scummvm-rg350-2ef15f51a7eb043f56d29db74afd3f87a9f19394.zip
Added guard to prevent crashing if a hospot or character name is needed and was not provided
svn-id: r25581
Diffstat (limited to 'engines/lure/strings.cpp')
-rw-r--r--engines/lure/strings.cpp7
1 files changed, 5 insertions, 2 deletions
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);