From 392a1ac437b3a61ca30f74de07f5afe056ad53dd Mon Sep 17 00:00:00 2001 From: Willi Ye Date: Tue, 21 Jul 2020 20:15:28 +0200 Subject: [PATCH] account: Remove unnecessary null termination --- app/src/main/cpp/skyline/services/account/IProfile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/services/account/IProfile.cpp b/app/src/main/cpp/skyline/services/account/IProfile.cpp index ffd268a8..6bfe6f09 100644 --- a/app/src/main/cpp/skyline/services/account/IProfile.cpp +++ b/app/src/main/cpp/skyline/services/account/IProfile.cpp @@ -28,9 +28,8 @@ namespace skyline::service::account { }; auto username = state.settings->GetString("username_value"); - size_t usernameSize = std::min(accountProfileBase.nickname.size(), username.size()); + size_t usernameSize = std::min(accountProfileBase.nickname.size() - 1, username.size()); std::memcpy(accountProfileBase.nickname.data(), username.c_str(), usernameSize); - accountProfileBase.nickname[accountProfileBase.nickname.size() - 1] = '\0'; auto userData = state.process->GetPointer(request.outputBuf.at(0).address); userData->iconBackgroundColorID = 0x1; // Color indexing starts at 0x1