Skip to content

Commit 70ea3c2

Browse files
committed
posix.cfg: Added nullPointer tests for getop()
1 parent 521f0ce commit 70ea3c2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/cfg/posix.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
#include <string.h>
3737
#include <strings.h>
3838

39+
int nullPointer_getopt(int argc, char* const argv[], const char* optstring)
40+
{
41+
// cppcheck-suppress nullPointer
42+
(void) getopt(argc, NULL, optstring);
43+
// cppcheck-suppress nullPointer
44+
(void) getopt(argc, argv, NULL);
45+
return getopt(argc, argv, optstring);
46+
}
47+
3948
int invalidFunctionArgStr_mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio)
4049
{
4150
// No warning is expected for:

0 commit comments

Comments
 (0)