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

This commit is contained in:
orbitcowboy 2022-04-20 18:15:54 +02:00
parent a8a821a9c7
commit 7cbdea9b81
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);
}
int nullPointer_strcasecmp(char *a, char *b)
{
// No warning shall be shown:
(void) strcasecmp(a, b);
// cppcheck-suppress nullPointer
(void) strcasecmp(a, NULL);
// cppcheck-suppress nullPointer
return strcasecmp(NULL, b);
}
int nullPointer_strncasecmp(char *a, char *b, size_t n)
{
// No warning shall be shown: