From 76fc8b59b261c62d73ae44eba2cd8b3a4cbe14cb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 15 Oct 2018 20:11:42 -0400 Subject: file_sys/control_metadata: Get rid of magic constants These are just the size of the data being passed in, so we can specify that via the size() member function. --- src/core/file_sys/control_metadata.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/file_sys/control_metadata.cpp b/src/core/file_sys/control_metadata.cpp index 6bb588080..a012c2be9 100644 --- a/src/core/file_sys/control_metadata.cpp +++ b/src/core/file_sys/control_metadata.cpp @@ -17,11 +17,13 @@ const std::array LANGUAGE_NAMES = { }; std::string LanguageEntry::GetApplicationName() const { - return Common::StringFromFixedZeroTerminatedBuffer(application_name.data(), 0x200); + return Common::StringFromFixedZeroTerminatedBuffer(application_name.data(), + application_name.size()); } std::string LanguageEntry::GetDeveloperName() const { - return Common::StringFromFixedZeroTerminatedBuffer(developer_name.data(), 0x100); + return Common::StringFromFixedZeroTerminatedBuffer(developer_name.data(), + developer_name.size()); } NACP::NACP(VirtualFile file) : raw(std::make_unique()) { @@ -61,6 +63,7 @@ u64 NACP::GetDLCBaseTitleId() const { } std::string NACP::GetVersionString() const { - return Common::StringFromFixedZeroTerminatedBuffer(raw->version_string.data(), 0x10); + return Common::StringFromFixedZeroTerminatedBuffer(raw->version_string.data(), + raw->version_string.size()); } } // namespace FileSys -- cgit v1.2.3