mirror of
https://github.com/Nightkingale/Wii-U-Account-Swap.git
synced 2026-04-26 08:17:06 -05:00
Use snprintf over sprintf for safety
This commit is contained in:
parent
8137beb776
commit
e30893b7d0
|
|
@ -52,7 +52,7 @@ get_user_information()
|
|||
// Get the user's persistent ID.
|
||||
PERSISTENT_ID = nn::act::GetPersistentId();
|
||||
char persistent_id_hex[9];
|
||||
sprintf(persistent_id_hex, "%08x", PERSISTENT_ID);
|
||||
snprintf(persistent_id_hex, sizeof persistent_id_hex, "%08x", PERSISTENT_ID);
|
||||
|
||||
// Set the account file path.
|
||||
ACCOUNT_FILE = "storage_mlc:/usr/save/system/act/" + std::string(persistent_id_hex) + "/account.dat";
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ user_check(FILE* backup, account account_type)
|
|||
|
||||
// Prepare the search string, including the user's persistent ID.
|
||||
char persistent_id_hex[9];
|
||||
sprintf(persistent_id_hex, "%08x", PERSISTENT_ID);
|
||||
snprintf(persistent_id_hex, sizeof persistent_id_hex, "%08x", PERSISTENT_ID);
|
||||
std::string search_string = "PersistentId=" + std::string(persistent_id_hex);
|
||||
bool found = false;
|
||||
rewind(backup);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user