Skip to content

Commit 7cbdea9

Browse files
committed
posix.cfg: Ensure null pointer input is correctly handled for strcasecmp().
1 parent a8a821a commit 7cbdea9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/cfg/posix.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ char * overlappingWriteFunction_stpcpy(char *src, char *dest)
216216
return stpcpy(src, src);
217217
}
218218

219+
int nullPointer_strcasecmp(char *a, char *b)
220+
{
221+
// No warning shall be shown:
222+
(void) strcasecmp(a, b);
223+
// cppcheck-suppress nullPointer
224+
(void) strcasecmp(a, NULL);
225+
// cppcheck-suppress nullPointer
226+
return strcasecmp(NULL, b);
227+
}
228+
219229
int nullPointer_strncasecmp(char *a, char *b, size_t n)
220230
{
221231
// No warning shall be shown:

0 commit comments

Comments
 (0)