summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-09-29 08:03:47 +0200
committergerman77 <juangerman-13@hotmail.com>2022-10-02 19:34:24 +0200
commit1485daff06b7e2aeb7077a4bdb1574956a4c3b82 (patch)
treed3f23b94d9b139ef94d9a103c869c92acad31afa
parentservice: nfp: Implement mount target and open application area errors, minor fixes (diff)
downloadyuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar.gz
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar.bz2
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar.lz
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar.xz
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.tar.zst
yuzu-1485daff06b7e2aeb7077a4bdb1574956a4c3b82.zip
-rw-r--r--src/core/hle/service/mii/mii_manager.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp
index 4bc8703e1..3a2fe938f 100644
--- a/src/core/hle/service/mii/mii_manager.cpp
+++ b/src/core/hle/service/mii/mii_manager.cpp
@@ -442,8 +442,15 @@ CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const {
mii.height = mii_v3.height;
mii.build = mii_v3.build;
- memset(mii.name.data(), 0, mii.name.size());
- memcpy(mii.name.data(), mii_v3.mii_name.data(), mii_v3.mii_name.size());
+ // Copy name until string terminator
+ mii.name = {};
+ for (std::size_t index = 0; index < mii.name.size() - 1; index++) {
+ mii.name[index] = mii_v3.mii_name[index];
+ if (mii.name[index] == 0) {
+ break;
+ }
+ }
+
mii.font_region = mii_v3.region_information.character_set;
mii.faceline_type = mii_v3.appearance_bits1.face_shape;
@@ -515,7 +522,15 @@ Ver3StoreData MiiManager::ConvertCharInfoToV3(const CharInfo& mii) const {
mii_v3.height = mii.height;
mii_v3.build = mii.build;
- memcpy(mii_v3.mii_name.data(), mii.name.data(), mii.name.size());
+ // Copy name until string terminator
+ mii_v3.mii_name = {};
+ for (std::size_t index = 0; index < mii.name.size() - 1; index++) {
+ mii_v3.mii_name[index] = mii.name[index];
+ if (mii_v3.mii_name[index] == 0) {
+ break;
+ }
+ }
+
mii_v3.region_information.character_set.Assign(mii.font_region);
mii_v3.appearance_bits1.face_shape.Assign(mii.faceline_type);