From 5b086651ba61b8e51c702840bec12cddefb1188e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 30 Oct 2013 23:10:30 +0100 Subject: TOON: For consistency, replace the remaining strncpy by strlcpy --- engines/toon/font.cpp | 3 +-- engines/toon/script.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/toon') diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index c01612084e..2ba4eff652 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -197,8 +197,7 @@ void FontRenderer::renderMultiLineText(int16 x, int16 y, const Common::String &o // divide the text in several lines // based on number of characters or size of lines. byte text[1024]; - strncpy((char *)text, origText.c_str(), 1023); - text[1023] = 0; + Common::strlcpy((char *)text, origText.c_str(), 1024); byte *lines[16]; int32 lineSize[16]; diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp index 3e6738f479..d752c277db 100644 --- a/engines/toon/script.cpp +++ b/engines/toon/script.cpp @@ -134,8 +134,7 @@ bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Commo _scriptData->sysFuncs = opcodes; - strncpy(_scriptData->filename, filename, 13); - _scriptData->filename[12] = 0; + Common::strlcpy(_scriptData->filename, filename, 13); _scriptData = 0; _filename = 0; -- cgit v1.2.3