From 0898bfd977668846f60195531d26a92ce9ac7f4e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 30 Oct 2013 00:27:10 +0100 Subject: TOON: Fix CID 1002425, 1002426, 1003214 --- engines/toon/script_func.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/toon/script_func.cpp') diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 1fa4058114..06580cde2e 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -1060,9 +1060,9 @@ int32 ScriptFunc::sys_Cmd_Set_Location_Data(EMCState *state) { // initial setup of locations int32 locationId = stackPos(0); debugC(0, 0, "setlocationdata(%d) %s %x %s %s %d %d", locationId, GetText(1, state), stackPos(2), GetText(3, state), GetText(4, state), stackPos(5), stackPos(6)); - strcpy(_vm->state()->_locations[locationId]._name, GetText(1, state)); - strcpy(_vm->state()->_locations[locationId]._music, GetText(3, state)); - strcpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state)); + strncpy(_vm->state()->_locations[locationId]._name, GetText(1, state), 64); + strncpy(_vm->state()->_locations[locationId]._music, GetText(3, state), 64); + strncpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state), 64); _vm->state()->_locations[locationId]._flags = stackPos(2); _vm->state()->_locations[locationId]._visited = false; _vm->state()->_locations[locationId]._numSceneAnimations = stackPos(5); -- cgit v1.2.3 From 22df279adc710294e69b1c9b44df56673489121d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 30 Oct 2013 21:34:24 +0100 Subject: TOON: replace strncpy by strlcpy as suggested by LordHoto --- engines/toon/script_func.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/toon/script_func.cpp') diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 06580cde2e..70baaaef22 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -1060,9 +1060,9 @@ int32 ScriptFunc::sys_Cmd_Set_Location_Data(EMCState *state) { // initial setup of locations int32 locationId = stackPos(0); debugC(0, 0, "setlocationdata(%d) %s %x %s %s %d %d", locationId, GetText(1, state), stackPos(2), GetText(3, state), GetText(4, state), stackPos(5), stackPos(6)); - strncpy(_vm->state()->_locations[locationId]._name, GetText(1, state), 64); - strncpy(_vm->state()->_locations[locationId]._music, GetText(3, state), 64); - strncpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state), 64); + Common::strlcpy(_vm->state()->_locations[locationId]._name, GetText(1, state), 64); + Common::strlcpy(_vm->state()->_locations[locationId]._music, GetText(3, state), 64); + Common::strlcpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state), 64); _vm->state()->_locations[locationId]._flags = stackPos(2); _vm->state()->_locations[locationId]._visited = false; _vm->state()->_locations[locationId]._numSceneAnimations = stackPos(5); -- cgit v1.2.3