Suppress strcpy-related errors on a global level

This commit is contained in:
2025-03-04 14:45:47 +01:00
parent 55aabb0468
commit d975af75a2
2 changed files with 1 additions and 3 deletions

View File

@ -9,7 +9,7 @@ stages:
cppcheck: cppcheck:
stage: lint stage: lint
script: script:
- cppcheck --std=c++17 --addon=cert --addon=misc --error-exitcode=1 src/*.cpp - cppcheck --std=c++17 --addon=cert --addon=misc --suppress=cert-STR07-C --error-exitcode=1 src/*.cpp
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
tags: tags:

View File

@ -45,7 +45,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
if (lenToBeAppended < capacityFullMessage) { if (lenToBeAppended < capacityFullMessage) {
// We check before that the capacity of fullMessage is sufficient // We check before that the capacity of fullMessage is sufficient
// cppcheck-suppress cert-STR07-C
strcpy(fullMessage, toBeAppended); strcpy(fullMessage, toBeAppended);
} }
} else { } else {
@ -58,7 +57,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
// fullMessage[lenFullMessage + 1] = '\0'; // fullMessage[lenFullMessage + 1] = '\0';
// We check before that the capacity of fullMessage is sufficient // We check before that the capacity of fullMessage is sufficient
// cppcheck-suppress cert-STR07-C
strcat(fullMessage, toBeAppended); strcat(fullMessage, toBeAppended);
} }
} }