mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
sys: Fixed reading empty file as string crashing
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user