From 55aabb046848f1aed6066db5e95cfe88930ea1ca Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 4 Mar 2025 14:37:04 +0100 Subject: [PATCH] Suppress strcpy-linter message --- src/masterMacsAxis.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index 6d5c826..ffb6e19 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -43,7 +43,9 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage, // The error message is empty -> Just copy the content of toBeAppended // into fullMessage, if the formers capacity suffices if (lenToBeAppended < capacityFullMessage) { - // cppcheck-suppress unsafeStrcpy + + // We check before that the capacity of fullMessage is sufficient + // cppcheck-suppress cert-STR07-C strcpy(fullMessage, toBeAppended); } } else { @@ -55,7 +57,8 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage, // fullMessage[lenFullMessage] = '\n'; // 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); } }