diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp index 9e81d6a7..68b9d13f 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp @@ -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); diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp index 6786f993..a909ffcc 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp @@ -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(fileBuffer); manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile);