summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorPhilippe Babin <philippe.babin@gmail.com>2018-09-18 19:58:28 -0400
committerbunnei <bunneidev@gmail.com>2018-09-18 19:58:28 -0400
commit9155c8daeb2207dfa23ab4bf33a2ba244a325cf9 (patch)
treee5ff7af81fc0075b357ed9d698d7db194004e96b /src/core
parent733c47623b98d873b58ce796b672b7b3d4081b0c (diff)
Invalid default value of username in yuzu_cmd (#1334)
* Fix bug where default username value for yuzu_cmd create an userprofile with uninitialize data as username * Fix format * Apply code review changes * Remove nullptr check
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 0071ca613..bcb3475db 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -25,7 +25,7 @@ const UUID& UUID::Generate() {
ProfileManager::ProfileManager() {
// TODO(ogniK): Create the default user we have for now until loading/saving users is added
auto user_uuid = UUID{1, 0};
- CreateNewUser(user_uuid, Settings::values.username);
+ ASSERT(CreateNewUser(user_uuid, Settings::values.username).IsSuccess());
OpenUser(user_uuid);
}
@@ -91,7 +91,8 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& usern
/// specifically by allowing an std::string for the username. This is required specifically since
/// we're loading a string straight from the config
ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
- ProfileUsername username_output;
+ ProfileUsername username_output{};
+
if (username.size() > username_output.size()) {
std::copy_n(username.begin(), username_output.size(), username_output.begin());
} else {