aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/script_func.cpp
diff options
context:
space:
mode:
authorD G Turner2019-09-15 18:15:19 +0100
committerD G Turner2019-09-15 18:15:19 +0100
commit28fe02eb305d3de8e3e2da5791b0f7c74d68c255 (patch)
tree2d6b5dc929b3bb0d4faec67fd4ced43bdae2324a /engines/toon/script_func.cpp
parent04242ce829bd55f03e084b85a23055b23e598fb6 (diff)
downloadscummvm-rg350-28fe02eb305d3de8e3e2da5791b0f7c74d68c255.tar.gz
scummvm-rg350-28fe02eb305d3de8e3e2da5791b0f7c74d68c255.tar.bz2
scummvm-rg350-28fe02eb305d3de8e3e2da5791b0f7c74d68c255.zip
TOON: 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/toon/script_func.cpp')
-rw-r--r--engines/toon/script_func.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp
index d2a9de3c02..761852b66f 100644
--- a/engines/toon/script_func.cpp
+++ b/engines/toon/script_func.cpp
@@ -311,14 +311,15 @@ int32 ScriptFunc::sys_Cmd_Flip_Screens(EMCState *state) {
}
int32 ScriptFunc::sys_Cmd_Play_Flic(EMCState *state) {
-
+ Common::String stateText = GetText(0, state);
Common::String name;
// workaround for the video of the beginning
- if (strstr(GetText(0, state), "209"))
- name = GetText(0, state);
- else
- name = _vm->createRoomFilename(GetText(0, state));
+ if (stateText.contains("209")) {
+ name = stateText;
+ } else {
+ name = _vm->createRoomFilename(stateText.c_str());
+ }
int32 stopMusic = stackPos(2);
_vm->getMoviePlayer()->play(name, stopMusic);