Suppress strcpy-related errors on a global level
This commit is contained in:
@ -9,7 +9,7 @@ stages:
|
||||
cppcheck:
|
||||
stage: lint
|
||||
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:
|
||||
expire_in: 1 week
|
||||
tags:
|
||||
|
@ -45,7 +45,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
|
||||
if (lenToBeAppended < capacityFullMessage) {
|
||||
|
||||
// We check before that the capacity of fullMessage is sufficient
|
||||
// cppcheck-suppress cert-STR07-C
|
||||
strcpy(fullMessage, toBeAppended);
|
||||
}
|
||||
} else {
|
||||
@ -58,7 +57,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage,
|
||||
// fullMessage[lenFullMessage + 1] = '\0';
|
||||
|
||||
// We check before that the capacity of fullMessage is sufficient
|
||||
// cppcheck-suppress cert-STR07-C
|
||||
strcat(fullMessage, toBeAppended);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user