account: Remove unnecessary null termination

This commit is contained in:
Willi Ye 2020-07-21 20:15:28 +02:00 committed by ◱ PixelyIon
parent 1f282af87e
commit 392a1ac437

View File

@ -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<AccountUserData>(request.outputBuf.at(0).address);
userData->iconBackgroundColorID = 0x1; // Color indexing starts at 0x1