diff options
| author | Léo Lam <leolino.lam@gmail.com> | 2018-04-20 17:58:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-20 17:58:11 +0200 |
| commit | e169329e5b2281dca24ea12f90993ef17c059cd7 (patch) | |
| tree | efb40ab4d05d3d2338d2b6235405f552d4f7527d /Source | |
| parent | a500347345136b2fbc3535da27af2f81ac808a0b (diff) | |
| parent | 1176ae6512c6a3ae271fef7b1ae45c5e8d5d822e (diff) | |
Merge pull request #6671 from leoetlino/bug
IOS/FS: Fix ReadDir bugs
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/IOS/FS/FileSystemProxy.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp index fbabef74cb..587577d497 100644 --- a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp +++ b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp @@ -467,8 +467,10 @@ IPCCommandResult FS::ReadDirectory(const Handle& handle, const IOCtlVRequest& re Memory::Memset(file_list_address, 0, 13); Memory::CopyToEmu(file_list_address, (*list)[i].data(), (*list)[i].size()); Memory::Write_U8(0, file_list_address + 12); - file_list_address += 13; + file_list_address += static_cast<u32>((*list)[i].size()) + 1; } + // 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); } |
