aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/string.cpp
diff options
context:
space:
mode:
authorD G Turner2019-09-15 20:20:03 +0100
committerD G Turner2019-09-15 20:20:03 +0100
commit84d0a294af531c770062f3e65ca9a1b5b1b17f02 (patch)
treedc4c7d67aa7c99e6838973b14026bb069479d540 /engines/scumm/string.cpp
parent34f3e8667c89a3187878d75528e5cd79e618ba50 (diff)
downloadscummvm-rg350-84d0a294af531c770062f3e65ca9a1b5b1b17f02.tar.gz
scummvm-rg350-84d0a294af531c770062f3e65ca9a1b5b1b17f02.tar.bz2
scummvm-rg350-84d0a294af531c770062f3e65ca9a1b5b1b17f02.zip
SCUMM: Replace Various String Functions with Common String Usage
This removes the dependency on the unsafe strcpy and strcat string functions with usage of Common::String instead.
Diffstat (limited to 'engines/scumm/string.cpp')
-rw-r--r--engines/scumm/string.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 9ea889c02b..a127de380e 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -1481,16 +1481,15 @@ void ScummEngine_v7::playSpeech(const byte *ptr) {
return;
if ((_game.id == GID_DIG || _game.id == GID_CMI) && ptr[0]) {
- char pointer[20];
- strcpy(pointer, (const char *)ptr);
+ Common::String pointerStr((const char *)ptr);
// Play speech
if (!(_game.features & GF_DEMO) && (_game.id == GID_CMI)) // CMI demo does not have .IMX for voice
- strcat(pointer, ".IMX");
+ pointerStr += ".IMX";
_sound->stopTalkSound();
_imuseDigital->stopSound(kTalkSoundID);
- _imuseDigital->startVoice(kTalkSoundID, pointer);
+ _imuseDigital->startVoice(kTalkSoundID, pointerStr.c_str());
_sound->talkSound(0, 0, 2);
}
}