sys: Fixed reading empty file as string crashing
This commit is contained in:
parent
4b9aff5b29
commit
545604da63
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user