diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/fsa/fs_i_file.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/file_sys/fsa/fs_i_file.h b/src/core/file_sys/fsa/fs_i_file.h index 6dd0f6439..8fdd71c80 100644 --- a/src/core/file_sys/fsa/fs_i_file.h +++ b/src/core/file_sys/fsa/fs_i_file.h @@ -16,7 +16,7 @@ namespace FileSys::Fsa { class IFile { public: - IFile(VirtualFile backend_) : backend(std::move(backend_)) {} + explicit IFile(VirtualFile backend_) : backend(std::move(backend_)) {} virtual ~IFile() {} Result Read(size_t* out, s64 offset, void* buffer, size_t size, const ReadOption& option) { @@ -126,8 +126,10 @@ protected: private: Result DoRead(size_t* out, s64 offset, void* buffer, size_t size, const ReadOption& option) { std::vector<u8> output = backend->ReadBytes(size, offset); + *out = output.size(); - buffer = output.data(); + std::memcpy(buffer, output.data(), size); + R_SUCCEED(); } |