1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-03-04 06:10:23 +01:00

Removed strnlen

This commit is contained in:
Anthony Scemama 2024-12-05 14:09:46 +01:00
parent a5d39acc92
commit 72619db8c4

View File

@ -841,7 +841,8 @@ void
trexio_string_of_error_f (const trexio_exit_code error, char result[<<MAX_STRING_LENGTH()>>])
{
const char* pSrc = trexio_string_of_error(error);
size_t sizeCp = strnlen(pSrc, <<MAX_STRING_LENGTH()>>);
size_t sizeCp = strlen(pSrc);
if (sizeCp > MAX_STRING_LENGTH) sizeCp = MAX_STRING_LENGTH;
memcpy(result, pSrc, sizeCp);
result[sizeCp] = '\0';
}