mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
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:
parent
d1da820a75
commit
5bb4fadc4c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user