summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/vfs.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-24 22:28:17 +0200
committerGitHub <noreply@github.com>2018-10-24 22:28:17 +0200
commitcdd499c261c289e5718e3d0897fc0cdfab483e7e (patch)
treeba88e88eaf5dc45d8ac641176b121862d88961d8 /src/core/file_sys/vfs.cpp
parentMerge pull request #1559 from lioncash/log (diff)
parentvfs: Handle failure of file reading within VfsRawCopy() (diff)
downloadyuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar.gz
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar.bz2
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar.lz
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar.xz
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.tar.zst
yuzu-cdd499c261c289e5718e3d0897fc0cdfab483e7e.zip
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
-rw-r--r--src/core/file_sys/vfs.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp
index bfe50da73..3824c74e0 100644
--- a/src/core/file_sys/vfs.cpp
+++ b/src/core/file_sys/vfs.cpp
@@ -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()));
for (std::size_t i = 0; i < src->GetSize(); i += block_size) {
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;
+ }
+
+ if (dest->Write(temp.data(), read, i) != read) {
+ return false;
+ }
}
return true;