Fix reading past the end of a file

This commit is contained in:
piepie62 2019-04-15 13:08:53 -07:00
parent 353f7d1705
commit 1e0baeb30e

View File

@ -71,7 +71,7 @@ Result IFile_Read(IFile *file, u64 *total, void *buffer, u32 len)
while (1) while (1)
{ {
res = FSFILE_Read(file->handle, &read, file->pos, buf, left); res = FSFILE_Read(file->handle, &read, file->pos, buf, left);
if (R_FAILED(res)) if (R_FAILED(res) || read == 0)
{ {
break; break;
} }