From 5bb4fadc4c85e14b5881fb3849ea32233dba91ed Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 31 May 2010 18:05:39 +0000 Subject: Fix change in r49356, Common::strlcpy should only be used on zero terminated source strings. The original code change with r49086 did only aimed at zero terminating the szFilename string (as the comment suggests), so I now changed it to use memcpy and a manual placement of the terminating zero. svn-id: r49357 --- engines/tinsel/handle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index b006f718b7..60eb08a2dd 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -288,7 +288,8 @@ void LoadFile(MEMHANDLE *pH) { } // extract and zero terminate the filename - Common::strlcpy(szFilename, pH->szName, sizeof(pH->szName)+1); + memcpy(szFilename, pH->szName, sizeof(pH->szName)); + szFilename[sizeof(pH->szName)] = 0; if (f.open(szFilename)) { // read the data -- cgit v1.2.3