From e0508c6c6485d5d6ad5d2ef50c07480517725b29 Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Tue, 15 Aug 2017 14:08:16 +0200 Subject: [PATCH] unpkg fix --- rpcs3/Crypto/unpkg.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 9450f46bb0..c6fb943f62 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -60,10 +60,16 @@ bool pkg_install(const fs::file& pkg_f, const std::string& dir, atomic_t } u64 num_read = filelist[cur_file].read((u8 *)data_ptr + num_bytes_left, num_bytes - num_bytes_left); cur_offset += (num_read + num_bytes_left); - cur_file_offset = num_bytes - num_bytes_left; - return num_read; + cur_file_offset = num_read; + return (num_read+num_bytes_left); } - return filelist[cur_file].read((u8 *)data_ptr, num_bytes); + + u64 num_read = filelist[cur_file].read((u8 *)data_ptr, num_bytes); + + cur_offset += num_read; + cur_file_offset += num_read; + + return num_read; };