posix.cfg: Ensure null pointer input is correctly handled for stpcpy().

This commit is contained in:
orbitcowboy 2022-04-20 17:52:38 +02:00
parent 1055b118a4
commit c17d3a1022
1 changed files with 10 additions and 0 deletions

View File

@ -216,6 +216,16 @@ char * overlappingWriteFunction_stpcpy(char *src, char *dest)
return stpcpy(src, src);
}
char * nullPointer_stpcpy(char *src, char *dest)
{
// No warning shall be shown:
(void) stpcpy(dest, src);
// cppcheck-suppress nullPointer
(void) stpcpy(dest, NULL);
// cppcheck-suppress nullPointer
return stpcpy(NULL, src);
}
void overlappingWriteFunction_bcopy(char *buf, const size_t count)
{
// No warning shall be shown: