summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/archive_savedatacheck.cpp
diff options
context:
space:
mode:
authorcondut <>2015-07-09 23:55:23 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-14 00:57:12 +0200
commitc385b7767d32eccabbfeaa12764310cfc3d113b9 (patch)
tree1868679b3e7c30c05eb76d5e1f09fd01c86e3e65 /src/core/file_sys/archive_savedatacheck.cpp
parentMerge pull request #927 from yuriks/getopt-fix (diff)
downloadyuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar.gz
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar.bz2
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar.lz
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar.xz
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.tar.zst
yuzu-c385b7767d32eccabbfeaa12764310cfc3d113b9.zip
Diffstat (limited to 'src/core/file_sys/archive_savedatacheck.cpp')
-rw-r--r--src/core/file_sys/archive_savedatacheck.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp
index dec838cae..ea1dfe2c7 100644
--- a/src/core/file_sys/archive_savedatacheck.cpp
+++ b/src/core/file_sys/archive_savedatacheck.cpp
@@ -37,17 +37,14 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(co
auto vec = path.AsBinary();
const u32* data = reinterpret_cast<u32*>(vec.data());
std::string file_path = GetSaveDataCheckPath(mount_point, data[1], data[0]);
- FileUtil::IOFile file(file_path, "rb");
+ auto file = std::make_shared<FileUtil::IOFile>(file_path, "rb");
- if (!file.IsOpen()) {
+ if (!file->IsOpen()) {
return ResultCode(-1); // TODO(Subv): Find the right error code
}
- auto size = file.GetSize();
- auto raw_data = std::make_shared<std::vector<u8>>(size);
- file.ReadBytes(raw_data->data(), size);
- file.Close();
+ auto size = file->GetSize();
- auto archive = Common::make_unique<IVFCArchive>(std::move(raw_data));
+ auto archive = Common::make_unique<IVFCArchive>(file, 0, size);
return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
}