mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-06 11:22:15 +02:00
Use sizeof instead of strnlen
This commit is contained in:
parent
928b66a3b6
commit
b65594a060
@ -43,9 +43,9 @@ void errorConfigSetCustomText(ErrorConfig* c, bool custom_text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void errorConfigSetShortDescription(ErrorConfig* c, const char* str) {
|
void errorConfigSetShortDescription(ErrorConfig* c, const char* str) {
|
||||||
strncpy(c->short_description, str, strnlen(str, 0x800));
|
strncpy(c->short_description, str, sizeof(c->short_description) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void errorConfigSetDetailedDescription(ErrorConfig* c, const char* str) {
|
void errorConfigSetDetailedDescription(ErrorConfig* c, const char* str) {
|
||||||
strncpy(c->detailed_description, str, strnlen(str, 0x800));
|
strncpy(c->detailed_description, str, sizeof(c->detailed_description) - 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user