Suppress strcpy-related errors on a global level
This commit is contained in:
@ -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:
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user