diff --git a/account/source/main.c b/account/source/main.c index a7440a4..ebdd9a3 100644 --- a/account/source/main.c +++ b/account/source/main.c @@ -58,7 +58,7 @@ int main(int argc, char **argv) if (R_SUCCEEDED(rc)) { memset(username, 0, sizeof(username)); - strncpy(username, profilebase.username, sizeof(profilebase.username));//Even though profilebase.username usually has a NUL-terminator, don't assume it does for safety. + strncpy(username, profilebase.username, sizeof(username)-1);//Even though profilebase.username usually has a NUL-terminator, don't assume it does for safety. printf("Username: %s\n", username);//Note that the print-console doesn't support UTF-8. The username is UTF-8, so this will only display properly if there isn't any non-ASCII characters. To display it properly, a print method which supports UTF-8 should be used instead. diff --git a/app_controldata/source/main.c b/app_controldata/source/main.c index 7d4f793..b685268 100644 --- a/app_controldata/source/main.c +++ b/app_controldata/source/main.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) if (R_SUCCEEDED(rc)) { memset(name, 0, sizeof(name)); - strncpy(name, langentry->name, sizeof(langentry->name));//Don't assume the nacp string is NUL-terminated for safety. + strncpy(name, langentry->name, sizeof(name)-1);//Don't assume the nacp string is NUL-terminated for safety. printf("Name: %s\n", name);//Note that the print-console doesn't support UTF-8. The name is UTF-8, so this will only display properly if there isn't any non-ASCII characters. To display it properly, a print method which supports UTF-8 should be used instead.