mirror of https://github.com/PCSX2/pcsx2.git
gsdx: always NULL terminate resources on Windows
It is done automatically on Linux. Strings are much better with this NULL char ;) All credits go to turtleli v2: increase resize instead of push_back NULL char
This commit is contained in:
parent
ebae8b65f8
commit
38c4f5b6e7
|
@ -52,7 +52,9 @@ bool GSdxApp::LoadResource(int id, std::vector<char>& buff, const char* type)
|
|||
if(!hGlobal) return false;
|
||||
DWORD size = SizeofResource((HMODULE)s_hModule, hRsrc);
|
||||
if(!size) return false;
|
||||
buff.resize(size);
|
||||
// On Linux resources are always NULL terminated
|
||||
// Add + 1 on size to do the same for compatibility sake (required by GSDeviceOGL)
|
||||
buff.resize(size + 1);
|
||||
memcpy(buff.data(), LockResource(hGlobal), size);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue