diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2015-09-19 02:23:38 +0200 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2015-10-12 02:31:51 +0200 |
| commit | b1100e4aa0bf0f576749def0024ca71e28e8cb78 (patch) | |
| tree | 64cc7f516b7713f64b76b951860a74244ec0a440 /Source/Core/DiscIO | |
| parent | c8382cca83332bc1ef993acb225a88b8cf6a1b7d (diff) | |
DiscIO: use std::min() in WBFS
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/WbfsBlob.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/WbfsBlob.cpp b/Source/Core/DiscIO/WbfsBlob.cpp index 9607f15f3c..de768e9d5f 100644 --- a/Source/Core/DiscIO/WbfsBlob.cpp +++ b/Source/Core/DiscIO/WbfsBlob.cpp @@ -102,7 +102,7 @@ bool WbfsFileReader::ReadHeader() return false; m_blocks_per_disc = (WII_SECTOR_COUNT * WII_SECTOR_SIZE) / m_wbfs_sector_size; - m_disc_info_size = align(WII_DISC_HEADER_SIZE + m_blocks_per_disc * 2, m_hd_sector_size); + m_disc_info_size = align(WII_DISC_HEADER_SIZE + m_blocks_per_disc * sizeof(u16), m_hd_sector_size); // Read disc table m_files[0]->file.Seek(2, SEEK_CUR); @@ -122,7 +122,7 @@ bool WbfsFileReader::Read(u64 offset, u64 nbytes, u8* out_ptr) File::IOFile& data_file = SeekToCluster(offset, &read_size); if (read_size == 0) return false; - read_size = (read_size > nbytes) ? nbytes : read_size; + read_size = std::min(read_size, nbytes); if (!data_file.ReadBytes(out_ptr, read_size)) { |
