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

This commit is contained in:
orbitcowboy 2022-04-20 18:13:49 +02:00
parent f3fc5892e1
commit a8a821a9c7
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_strncasecmp(char *a, char *b, size_t n)
{
// No warning shall be shown:
(void) strncasecmp(a, b, n);
// cppcheck-suppress nullPointer
(void) strncasecmp(a, NULL, n);
// cppcheck-suppress nullPointer
return strncasecmp(NULL, b, n);
}
char * nullPointer_stpcpy(char *src, char *dest)
{
// No warning shall be shown: