1
0
mirror of synced 2025-02-20 04:01:01 +01:00

sys: Fixed reading empty file as string crashing

This commit is contained in:
WerWolv 2021-10-05 18:46:57 +02:00
parent 4b9aff5b29
commit 545604da63

View File

@ -57,6 +57,8 @@ namespace hex {
std::string File::readString(size_t numBytes) {
if (!isValid()) return { };
if (getSize() == 0) return { };
return reinterpret_cast<char*>(readBytes(numBytes).data());
}