From 1e0baeb30e64255e116b1df87953cd2195e85e05 Mon Sep 17 00:00:00 2001 From: piepie62 Date: Mon, 15 Apr 2019 13:08:53 -0700 Subject: [PATCH] Fix reading past the end of a file --- sysmodules/rosalina/source/ifile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/ifile.c b/sysmodules/rosalina/source/ifile.c index 18d8c00..430620a 100644 --- a/sysmodules/rosalina/source/ifile.c +++ b/sysmodules/rosalina/source/ifile.c @@ -71,7 +71,7 @@ Result IFile_Read(IFile *file, u64 *total, void *buffer, u32 len) while (1) { res = FSFILE_Read(file->handle, &read, file->pos, buf, left); - if (R_FAILED(res)) + if (R_FAILED(res) || read == 0) { break; }