mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 08:11:48 +01:00
Validate if entries are not empty before using
Should fix saving problem in Baldur's Gate: Dark Alliance II at least
This commit is contained in:
parent
5f510d84d7
commit
bbd34ae7e7
@ -28,17 +28,18 @@ namespace skyline::service::fssrv {
|
||||
auto outputEntries{request.outputBuf.at(0).cast<DirectoryEntry, std::dynamic_extent, true>()};
|
||||
size_t i{};
|
||||
|
||||
for (; i < std::min(entries.size() - remainingReadCount, outputEntries.size()); i++) {
|
||||
auto &entry{entries.at(i)};
|
||||
if (!entries.empty())
|
||||
for (; i < std::min(entries.size() - remainingReadCount, outputEntries.size()); i++) {
|
||||
auto &entry{entries.at(i)};
|
||||
|
||||
outputEntries[i] = {
|
||||
.type = entry.type,
|
||||
.attributes.directory = (entry.type == vfs::Directory::EntryType::Directory),
|
||||
.size = entry.size,
|
||||
};
|
||||
outputEntries[i] = {
|
||||
.type = entry.type,
|
||||
.attributes.directory = (entry.type == vfs::Directory::EntryType::Directory),
|
||||
.size = entry.size,
|
||||
};
|
||||
|
||||
span(outputEntries[i].name).copy_from(entry.name);
|
||||
}
|
||||
span(outputEntries[i].name).copy_from(entry.name);
|
||||
}
|
||||
|
||||
remainingReadCount += i;
|
||||
response.Push<u64>(i);
|
||||
|
Loading…
Reference in New Issue
Block a user