diff --git a/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp b/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp index 247063ab4..a22adcad0 100644 --- a/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp @@ -62,18 +62,14 @@ namespace ams::settings { char name[MaxLength]; - static constexpr LanguageCode Encode(const char *name, size_t name_size) { + static constexpr LanguageCode Encode(util::string_view name) { LanguageCode out{}; - for (size_t i = 0; i < MaxLength && i < name_size; i++) { + for (size_t i = 0; i < MaxLength && i < name.size(); i++) { out.name[i] = name[i]; } return out; } - static constexpr LanguageCode Encode(const char *name) { - return Encode(name, std::strlen(name)); - } - template static constexpr inline LanguageCode EncodeLanguage = [] { if constexpr (false) { /* ... */ } diff --git a/libraries/libstratosphere/include/stratosphere/sm/sm_types.hpp b/libraries/libstratosphere/include/stratosphere/sm/sm_types.hpp index f91546371..675802be1 100644 --- a/libraries/libstratosphere/include/stratosphere/sm/sm_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/sm/sm_types.hpp @@ -40,8 +40,8 @@ namespace ams::sm { return out; } - static constexpr ServiceName Encode(const char *name) { - return Encode(name, std::strlen(name)); + static constexpr ServiceName Encode(util::string_view name) { + return Encode(name.data(), name.size()); } };