Suppress strcpy-linter message
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user