From 72619db8c4b4313c9e5ffb77d58852e3ef054f16 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 5 Dec 2024 14:09:46 +0100 Subject: [PATCH] Removed strnlen --- src/templates_front/templator_front.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/templates_front/templator_front.org b/src/templates_front/templator_front.org index 96fa4a3..e1f1122 100644 --- a/src/templates_front/templator_front.org +++ b/src/templates_front/templator_front.org @@ -841,7 +841,8 @@ void trexio_string_of_error_f (const trexio_exit_code error, char result[<>]) { const char* pSrc = trexio_string_of_error(error); - size_t sizeCp = strnlen(pSrc, <>); + size_t sizeCp = strlen(pSrc); + if (sizeCp > MAX_STRING_LENGTH) sizeCp = MAX_STRING_LENGTH; memcpy(result, pSrc, sizeCp); result[sizeCp] = '\0'; }