diff --git a/nx/source/services/acc.c b/nx/source/services/acc.c index 71e7e4c4..8108ed17 100644 --- a/nx/source/services/acc.c +++ b/nx/source/services/acc.c @@ -112,8 +112,7 @@ static Result _accountListAllUsers(u128* userIDs) Result accountListAllUsers(u128* userIDs, size_t max_userIDs, size_t *actual_total) { Result rc=0; - u128 *temp_userIDs; - temp_userIDs = malloc(sizeof(u128) * ACC_USER_LIST_SIZE); + u128 *temp_userIDs = malloc(sizeof(u128) * ACC_USER_LIST_SIZE); rc = _accountListAllUsers(temp_userIDs); @@ -125,7 +124,7 @@ Result accountListAllUsers(u128* userIDs, size_t max_userIDs, size_t *actual_tot } if (max_userIDs > total_userIDs) { - memcpy(&max_userIDs, &total_userIDs, sizeof(size_t)); + max_userIDs = total_userIDs; } memcpy(userIDs, temp_userIDs, sizeof(u128) * max_userIDs);