sys: Catch error produced in file size querying

This commit is contained in:
WerWolv 2022-02-26 17:15:35 +01:00
parent 191a99f91b
commit b28eaf2dbf
1 changed files with 4 additions and 1 deletions

View File

@ -103,9 +103,12 @@ namespace hex {
auto startPos = ftello64(this->m_file);
fseeko64(this->m_file, 0, SEEK_END);
size_t size = ftello64(this->m_file);
auto size = ftello64(this->m_file);
fseeko64(this->m_file, startPos, SEEK_SET);
if (size < 0)
return 0;
return size;
}