Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10995 from JosJuice/nfs-size-out
DiscIO: Fix calculation of NFS raw size
  • Loading branch information
lioncash committed Aug 20, 2022
2 parents 924a4ee + aca624e commit fef8325
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Core/DiscIO/NFSBlob.cpp
Expand Up @@ -76,7 +76,7 @@ std::vector<File::IOFile> NFSFileReader::OpenFiles(const std::string& directory,
std::vector<File::IOFile> files;
files.reserve(file_count);

u64 raw_size = first_file.GetSize();
*raw_size_out = first_file.GetSize();
files.emplace_back(std::move(first_file));

for (u64 i = 1; i < file_count; ++i)
Expand All @@ -89,16 +89,16 @@ std::vector<File::IOFile> NFSFileReader::OpenFiles(const std::string& directory,
return {};
}

raw_size += child.GetSize();
*raw_size_out += child.GetSize();
files.emplace_back(std::move(child));
}

if (raw_size < expected_raw_size)
if (*raw_size_out < expected_raw_size)
{
ERROR_LOG_FMT(
DISCIO,
"Expected sum of NFS file sizes for {} to be at least {} bytes, but it was {} bytes",
directory, expected_raw_size, raw_size);
directory, expected_raw_size, *raw_size_out);
return {};
}

Expand Down

0 comments on commit fef8325

Please sign in to comment.