summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/archive_backend.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp
index 97adf0e12..cc0aa7022 100644
--- a/src/core/file_sys/archive_backend.cpp
+++ b/src/core/file_sys/archive_backend.cpp
@@ -19,22 +19,22 @@ Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) {
19 switch (type) { 19 switch (type) {
20 case Binary: 20 case Binary:
21 { 21 {
22 u8* data = Memory::GetPointer(pointer); 22 binary.resize(size);
23 binary = std::vector<u8>(data, data + size); 23 Memory::ReadBlock(pointer, binary.data(), binary.size());
24 break; 24 break;
25 } 25 }
26 26
27 case Char: 27 case Char:
28 { 28 {
29 const char* data = reinterpret_cast<const char*>(Memory::GetPointer(pointer)); 29 string.resize(size - 1); // Data is always null-terminated.
30 string = std::string(data, size - 1); // Data is always null-terminated. 30 Memory::ReadBlock(pointer, &string[0], string.size());
31 break; 31 break;
32 } 32 }
33 33
34 case Wchar: 34 case Wchar:
35 { 35 {
36 const char16_t* data = reinterpret_cast<const char16_t*>(Memory::GetPointer(pointer)); 36 u16str.resize(size / 2 - 1); // Data is always null-terminated.
37 u16str = std::u16string(data, size/2 - 1); // Data is always null-terminated. 37 Memory::ReadBlock(pointer, &u16str[0], u16str.size() * sizeof(char16_t));
38 break; 38 break;
39 } 39 }
40 40