[Scummvm-cvs-logs] SF.net SVN: scummvm:[49357] scummvm/trunk/engines/tinsel/handle.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon May 31 20:05:39 CEST 2010
Revision: 49357
http://scummvm.svn.sourceforge.net/scummvm/?rev=49357&view=rev
Author: lordhoto
Date: 2010-05-31 18:05:39 +0000 (Mon, 31 May 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/handle.cpp
Modified: scummvm/trunk/engines/tinsel/handle.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/handle.cpp 2010-05-31 15:16:46 UTC (rev 49356)
+++ scummvm/trunk/engines/tinsel/handle.cpp 2010-05-31 18:05:39 UTC (rev 49357)
@@ -288,7 +288,8 @@
}
// 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list