aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-10-30 21:34:24 +0100
committerStrangerke2013-10-30 22:43:59 +0100
commit22df279adc710294e69b1c9b44df56673489121d (patch)
tree2fd04a36893366cdcaac2b31e62d5e75407e168a
parentd9638677d2210af9012f4af038804eb5774358b4 (diff)
downloadscummvm-rg350-22df279adc710294e69b1c9b44df56673489121d.tar.gz
scummvm-rg350-22df279adc710294e69b1c9b44df56673489121d.tar.bz2
scummvm-rg350-22df279adc710294e69b1c9b44df56673489121d.zip
TOON: replace strncpy by strlcpy as suggested by LordHoto
-rw-r--r--engines/toon/anim.cpp2
-rw-r--r--engines/toon/script_func.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 76b4154d61..19e997af34 100644
--- a/engines/toon/anim.cpp
+++ b/engines/toon/anim.cpp
@@ -41,7 +41,7 @@ bool Animation::loadAnimation(const Common::String &file) {
if (strncmp((char *)fileData, "KevinAguilar", 12))
return false;
- strncpy(_name, file.c_str(), 32);
+ Common::strlcpy(_name, file.c_str(), 32);
uint32 headerSize = READ_LE_UINT32(fileData + 16);
uint32 uncompressedBytes = READ_LE_UINT32(fileData + 20);
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);