IOS/FS: Fix ReadDir returning wrong number of entries

ReadDir should always write the actual number of entries in the
directory list (`min(max_count, number_of_entries_on_nand)`).
This commit is contained in:
Léo Lam 2018-04-19 11:47:22 +02:00
parent a500347345
commit 4c47417a0e

View File

@ -469,6 +469,8 @@ IPCCommandResult FS::ReadDirectory(const Handle& handle, const IOCtlVRequest& re
Memory::Write_U8(0, file_list_address + 12);
file_list_address += 13;
}
// Write the actual number of entries in the buffer.
Memory::Write_U32(std::min(max_count, static_cast<u32>(list->size())), file_count_address);
return GetFSReply(IPC_SUCCESS);
}