diff --git a/include/kabufuda/File.hpp b/include/kabufuda/File.hpp index eb7d4d1..42135cc 100644 --- a/include/kabufuda/File.hpp +++ b/include/kabufuda/File.hpp @@ -18,6 +18,9 @@ class File { std::array m_maker; uint8_t m_reserved; uint8_t m_bannerFlags; +#if __GNUC__ && !__clang__ + __attribute__((nonstring)) +#endif char m_filename[0x20]; uint32_t m_modifiedTime; uint32_t m_iconAddress; diff --git a/lib/kabufuda/Directory.cpp b/lib/kabufuda/Directory.cpp index 20816e0..b1c5b4e 100644 --- a/lib/kabufuda/Directory.cpp +++ b/lib/kabufuda/Directory.cpp @@ -107,7 +107,7 @@ File* Directory::getFile(const char* game, const char* maker, const char* filena return false; } - return std::strcmp(file.m_filename, filename) == 0; + return std::strncmp(file.m_filename, filename, 32) == 0; }); if (iter == data.m_files.cend()) {