[Emulator] use filesystem::file_size instead of ftell where possible

This commit is contained in:
Gliniak
2024-03-22 11:03:34 +01:00
parent c9bf44f4f4
commit a966143823
3 changed files with 4 additions and 9 deletions

View File

@@ -307,9 +307,7 @@ X_RESULT ContentManager::GetContentThumbnail(
auto thumb_path = package_path / kThumbnailFileName;
if (std::filesystem::exists(thumb_path)) {
auto file = xe::filesystem::OpenFile(thumb_path, "rb");
fseek(file, 0, SEEK_END);
size_t file_len = ftell(file);
fseek(file, 0, SEEK_SET);
size_t file_len = std::filesystem::file_size(thumb_path);
buffer->resize(file_len);
fread(const_cast<uint8_t*>(buffer->data()), 1, buffer->size(), file);
fclose(file);