From b65594a060da620615943f97d5351b35fa073ca0 Mon Sep 17 00:00:00 2001 From: Liam Minopulos Date: Thu, 28 Feb 2019 09:00:01 +0100 Subject: [PATCH] Use sizeof instead of strnlen --- nx/source/applets/error.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx/source/applets/error.cpp b/nx/source/applets/error.cpp index 1dff4ac1..fe2fa634 100644 --- a/nx/source/applets/error.cpp +++ b/nx/source/applets/error.cpp @@ -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); }