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
This commit is contained in:
Johannes Schickel 2010-05-31 18:05:39 +00:00
parent d1da820a75
commit 5bb4fadc4c

View File

@ -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