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

This commit is contained in:
orbitcowboy 2022-04-20 17:58:50 +02:00
parent c17d3a1022
commit f3fc5892e1
1 changed files with 10 additions and 0 deletions

View File

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