diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp index 776a3eea45..33e8630467 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp @@ -408,7 +408,9 @@ std::string GCMemcard::DEntry_Makercode(u8 index) const if (!m_valid || index >= DIRLEN) return ""; - return std::string((const char*)CurrentDir->m_dir_entries[index].m_makercode, 2); + return std::string( + reinterpret_cast(CurrentDir->m_dir_entries[index].m_makercode.data()), + CurrentDir->m_dir_entries[index].m_makercode.size()); } std::string GCMemcard::DEntry_BIFlags(u8 index) const diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.h b/Source/Core/Core/HW/GCMemcard/GCMemcard.h index 0003ec0b0d..f17494e2cf 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.h +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.h @@ -168,7 +168,7 @@ struct DEntry std::string GCI_FileName() const { std::string filename = - std::string((char*)m_makercode, 2) + '-' + + std::string(reinterpret_cast(m_makercode.data()), m_makercode.size()) + '-' + std::string(reinterpret_cast(m_gamecode.data()), m_gamecode.size()) + '-' + reinterpret_cast(m_filename.data()) + ".gci"; return Common::EscapeFileName(filename); @@ -176,9 +176,9 @@ struct DEntry static constexpr std::array UNINITIALIZED_GAMECODE = {0xFF, 0xFF, 0xFF, 0xFF}; - std::array m_gamecode; // 0x00 0x04 Gamecode - u8 m_makercode[2]; // 0x04 0x02 Makercode - u8 m_unused_1; // 0x06 0x01 reserved/unused (always 0xff, has no effect) + std::array m_gamecode; // 0x00 0x04 Gamecode + std::array m_makercode; // 0x04 0x02 Makercode + u8 m_unused_1; // 0x06 0x01 reserved/unused (always 0xff, has no effect) u8 m_banner_and_icon_flags; // 0x07 0x01 banner gfx format and icon animation (Image Key) // Bit(s) Description // 2 Icon Animation 0: forward 1: ping-pong