mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
Set last byte of rawfile buffer to 0 when loading asset
This commit is contained in:
parent
a18f001130
commit
4380a6c9f2
@ -34,6 +34,7 @@ bool AssetLoaderRawFile::LoadFromRaw(const std::string& assetName, ISearchPath*
|
||||
file.m_stream->read(fileBuffer, file.m_length);
|
||||
if (file.m_stream->gcount() != file.m_length)
|
||||
return false;
|
||||
fileBuffer[rawFile->len] = '\0';
|
||||
|
||||
rawFile->data.buffer = fileBuffer;
|
||||
manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile);
|
||||
|
@ -34,6 +34,7 @@ bool AssetLoaderRawFile::LoadFromRaw(const std::string& assetName, ISearchPath*
|
||||
file.m_stream->read(fileBuffer, file.m_length);
|
||||
if (file.m_stream->gcount() != file.m_length)
|
||||
return false;
|
||||
fileBuffer[rawFile->len] = '\0';
|
||||
|
||||
rawFile->buffer = static_cast<char16*>(fileBuffer);
|
||||
manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user