Suppress strcpy-linter message

This commit is contained in:
2025-03-04 14:37:04 +01:00
parent 755ae42b3b
commit 55aabb0468

View File

@ -43,7 +43,9 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
// The error message is empty -> Just copy the content of toBeAppended // The error message is empty -> Just copy the content of toBeAppended
// into fullMessage, if the formers capacity suffices // into fullMessage, if the formers capacity suffices
if (lenToBeAppended < capacityFullMessage) { if (lenToBeAppended < capacityFullMessage) {
// cppcheck-suppress unsafeStrcpy
// We check before that the capacity of fullMessage is sufficient
// cppcheck-suppress cert-STR07-C
strcpy(fullMessage, toBeAppended); strcpy(fullMessage, toBeAppended);
} }
} else { } else {
@ -55,7 +57,8 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
// fullMessage[lenFullMessage] = '\n'; // fullMessage[lenFullMessage] = '\n';
// fullMessage[lenFullMessage + 1] = '\0'; // fullMessage[lenFullMessage + 1] = '\0';
// Append the actual message // We check before that the capacity of fullMessage is sufficient
// cppcheck-suppress cert-STR07-C
strcat(fullMessage, toBeAppended); strcat(fullMessage, toBeAppended);
} }
} }