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'; }