Skip to content
Snippets Groups Projects
Unverified Commit c7c594a6 authored by Lioncash's avatar Lioncash
Browse files

vfs: Handle failure of file reading within VfsRawCopy()

Also gets rid of an unused variable.
parent c6529688
No related branches found
No related tags found
No related merge requests found
...@@ -472,10 +472,14 @@ bool VfsRawCopy(const VirtualFile& src, const VirtualFile& dest, std::size_t blo ...@@ -472,10 +472,14 @@ bool VfsRawCopy(const VirtualFile& src, const VirtualFile& dest, std::size_t blo
std::vector<u8> temp(std::min(block_size, src->GetSize())); std::vector<u8> temp(std::min(block_size, src->GetSize()));
for (std::size_t i = 0; i < src->GetSize(); i += block_size) { for (std::size_t i = 0; i < src->GetSize(); i += block_size) {
const auto read = std::min(block_size, src->GetSize() - i); const auto read = std::min(block_size, src->GetSize() - i);
const auto block = src->Read(temp.data(), read, i);
if (dest->Write(temp.data(), read, i) != read) if (src->Read(temp.data(), read, i) != read) {
return false; return false;
}
if (dest->Write(temp.data(), read, i) != read) {
return false;
}
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment