use platform file functions for savestates and NAND importing file check

should fix character encoding issues on Windows
This commit is contained in:
RSDuck
2024-07-29 00:15:19 +02:00
parent c0ada2f445
commit 12563fb636
2 changed files with 16 additions and 24 deletions

View File

@ -303,7 +303,7 @@ void TitleManagerDialog::onImportTitleData()
if (file.isEmpty()) return;
FILE* f = fopen(file.toStdString().c_str(), "rb");
Platform::FileHandle* f = Platform::OpenFile(file.toStdString(), Platform::Read);
if (!f)
{
QMessageBox::critical(this,
@ -312,9 +312,8 @@ void TitleManagerDialog::onImportTitleData()
return;
}
fseek(f, 0, SEEK_END);
u64 len = ftell(f);
fclose(f);
u64 len = Platform::FileLength(f);
Platform::CloseFile(f);
if (len != wantedsize)
{