Use sizeof instead of strnlen

This commit is contained in:
Liam Minopulos 2019-02-28 09:00:01 +01:00
parent 928b66a3b6
commit b65594a060

View File

@ -43,9 +43,9 @@ void errorConfigSetCustomText(ErrorConfig* c, bool custom_text) {
}
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) {
strncpy(c->detailed_description, str, strnlen(str, 0x800));
strncpy(c->detailed_description, str, sizeof(c->detailed_description) - 1);
}