diff options
Diffstat (limited to 'src')
| -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 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <cinttypes> | 5 | #include <cinttypes> |
| 6 | #include <utility> | ||
| 7 | |||
| 6 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 7 | #include "common/string_util.h" | 9 | #include "common/string_util.h" |
| 8 | #include "core/core.h" | 10 | #include "core/core.h" |
| @@ -133,17 +135,16 @@ private: | |||
| 133 | return; | 135 | return; |
| 134 | } | 136 | } |
| 135 | 137 | ||
| 136 | std::vector<u8> data = ctx.ReadBuffer(); | 138 | const std::vector<u8> data = ctx.ReadBuffer(); |
| 137 | std::vector<u8> actual_data(length); | ||
| 138 | 139 | ||
| 139 | ASSERT_MSG( | 140 | ASSERT_MSG( |
| 140 | data.size() <= length, | 141 | data.size() <= length, |
| 141 | "Attempting to write more data than requested (requested={:016X}, actual={:016X}).", | 142 | "Attempting to write more data than requested (requested={:016X}, actual={:016X}).", |
| 142 | length, data.size()); | 143 | length, data.size()); |
| 143 | 144 | ||
| 144 | std::copy(data.begin(), data.end(), actual_data.begin()); | ||
| 145 | // Write the data to the Storage backend | 145 | // Write the data to the Storage backend |
| 146 | auto written = backend->WriteBytes(data, offset); | 146 | std::vector<u8> actual_data(data.begin(), data.begin() + length); |
| 147 | const auto written = backend->WriteBytes(std::move(actual_data), offset); | ||
| 147 | 148 | ||
| 148 | ASSERT_MSG(written == length, | 149 | ASSERT_MSG(written == length, |
| 149 | "Could not write all bytes to file (requested={:016X}, actual={:016X}).", length, | 150 | "Could not write all bytes to file (requested={:016X}, actual={:016X}).", length, |