mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-06 11:22:15 +02:00
Updated to address comments
This commit is contained in:
parent
a590ed50da
commit
1e4b2336a6
@ -119,12 +119,10 @@ Result accountListAllUsers(u128* userIDs, size_t max_userIDs, size_t *actual_tot
|
|||||||
rc = _accountListAllUsers(temp_userIDs);
|
rc = _accountListAllUsers(temp_userIDs);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
size_t total_userIDs = 0;
|
size_t total_userIDs;
|
||||||
|
for (total_userIDs = 0; total_userIDs < ACC_USER_LIST_SIZE; total_userIDs++) {
|
||||||
for (int i = 0; i < ACC_USER_LIST_SIZE; i++) {
|
if (!temp_userIDs[total_userIDs])
|
||||||
if (temp_userIDs[i]) {
|
break;
|
||||||
total_userIDs++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_userIDs > total_userIDs) {
|
if (max_userIDs > total_userIDs) {
|
||||||
@ -135,9 +133,11 @@ Result accountListAllUsers(u128* userIDs, size_t max_userIDs, size_t *actual_tot
|
|||||||
userIDs[i] = temp_userIDs[i];
|
userIDs[i] = temp_userIDs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
*actual_total = total_userIDs;
|
*actual_total = max_userIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(temp_userIDs);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user