diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-19 15:53:35 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-19 15:57:48 +0200 |
commit | d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426 (patch) | |
tree | 7e444921bee8ca9922431a3bd6da6e3ff9375690 /src/core/hle/service | |
parent | Merge pull request #700 from bunnei/update-dynarmic (diff) | |
download | yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar.gz yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar.bz2 yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar.lz yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar.xz yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.tar.zst yuzu-d6e9b96e2f16dd7aa37e580e5c2b10c15fc82426.zip |
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 1b003bd84..e3f237c5c 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -3,6 +3,8 @@ // Refer to the license.txt file included. #include <cinttypes> +#include <utility> + #include "common/logging/log.h" #include "common/string_util.h" #include "core/core.h" @@ -133,17 +135,16 @@ private: return; } - std::vector<u8> data = ctx.ReadBuffer(); - std::vector<u8> actual_data(length); + const std::vector<u8> data = ctx.ReadBuffer(); ASSERT_MSG( data.size() <= length, "Attempting to write more data than requested (requested={:016X}, actual={:016X}).", length, data.size()); - std::copy(data.begin(), data.end(), actual_data.begin()); // Write the data to the Storage backend - auto written = backend->WriteBytes(data, offset); + std::vector<u8> actual_data(data.begin(), data.begin() + length); + const auto written = backend->WriteBytes(std::move(actual_data), offset); ASSERT_MSG(written == length, "Could not write all bytes to file (requested={:016X}, actual={:016X}).", length, |