summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeGC.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-05-30 04:05:47 -0400
committerLioncash <mathew1800@gmail.com>2018-05-30 04:14:42 -0400
commit7bef4701363ef7a1ae309709deec47feb232d4bd (patch)
tree8b13a62f864c72617d308e9e919aded25c29d29a /Source/Core/DiscIO/VolumeGC.cpp
parent9bf5ad1f0e64e7895e1f954683f4ff027cb9c8ca (diff)
VolumeGC/VolumeWii: Dehardcode sizes where applicable
We can just use the relevant array to derive these sizes instead of hardcoding them directly.
Diffstat (limited to 'Source/Core/DiscIO/VolumeGC.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeGC.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp
index 4ce4c23499..f844d329c8 100644
--- a/Source/Core/DiscIO/VolumeGC.cpp
+++ b/Source/Core/DiscIO/VolumeGC.cpp
@@ -104,7 +104,7 @@ Country VolumeGC::GetCountry(const Partition& partition) const
std::string VolumeGC::GetMakerID(const Partition& partition) const
{
char maker_id[2];
- if (!Read(0x4, 0x2, reinterpret_cast<u8*>(&maker_id), partition))
+ if (!Read(0x4, sizeof(maker_id), reinterpret_cast<u8*>(&maker_id), partition))
return std::string();
return DecodeString(maker_id);
@@ -119,7 +119,7 @@ std::optional<u16> VolumeGC::GetRevision(const Partition& partition) const
std::string VolumeGC::GetInternalName(const Partition& partition) const
{
char name[0x60];
- if (Read(0x20, 0x60, (u8*)name, partition))
+ if (Read(0x20, sizeof(name), reinterpret_cast<u8*>(name), partition))
return DecodeString(name);
return "";
@@ -160,7 +160,7 @@ std::vector<u32> VolumeGC::GetBanner(u32* width, u32* height) const
std::string VolumeGC::GetApploaderDate(const Partition& partition) const
{
char date[16];
- if (!Read(0x2440, 0x10, (u8*)&date, partition))
+ if (!Read(0x2440, sizeof(date), reinterpret_cast<u8*>(&date), partition))
return std::string();
return DecodeString(date);