mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
Fixed incorrect error handling in ReadFile
This commit is contained in:
parent
84e94f97b3
commit
4014070607
1 changed files with 2 additions and 1 deletions
|
@ -61,7 +61,8 @@ namespace ams::ncm::fs {
|
|||
|
||||
Result ReadFile(FILE* f, size_t offset, void* buffer, size_t size) {
|
||||
R_UNLESS(fseek(f, offset, SEEK_SET) == 0, fsdevGetLastResult());
|
||||
R_UNLESS(fread(buffer, 1, size, f) == size || !ferror(f), fsdevGetLastResult());
|
||||
R_UNLESS(fread(buffer, 1, size, f) == size, fsdevGetLastResult());
|
||||
R_UNLESS(!ferror(f), fsdevGetLastResult());
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue