fix: Build on MSVC, properly handle empty files

(cherry picked from commit 54d9f8ec5c)
This commit is contained in:
WerWolv
2025-12-30 10:30:14 +01:00
parent 4a7544b9e7
commit 0c48aef5ee

View File

@@ -276,6 +276,7 @@ namespace hex::plugin::builtin {
m_data.resize(startSize + ChunkSize);
auto result = m_file.readBuffer(m_data.data() + startSize, ChunkSize);
if (result <= 0) {
m_data.resize(startSize);
break;
} else if (result < ChunkSize) {
m_data.resize(startSize + result);