Skip to content

Commit 7df6ba4

Browse files
committed
gnu.cfg: Added nullPointer tests for getop_long_only()
1 parent 70ea3c2 commit 7df6ba4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/cfg/gnu.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ int nullPointer_getopt_long(int argc, char **argv, const char *optstring,
4646
return getopt_long(argc, argv, optstring, longopts, longindex);
4747
}
4848

49+
int nullPointer_getopt_long_only(int argc, char* const* argv, const char* optstring,
50+
const struct option* longopts, int* longindex)
51+
{
52+
// cppcheck-suppress nullPointer
53+
(void) getopt_long_only(argc, NULL, optstring, longopts, longindex);
54+
// cppcheck-suppress nullPointer
55+
(void) getopt_long_only(argc, argv, NULL, longopts, longindex);
56+
// cppcheck-suppress nullPointer
57+
(void) getopt_long_only(argc, argv, optstring, NULL, longindex);
58+
return getopt_long_only(argc, argv, optstring, longopts, longindex);
59+
}
60+
4961
int nullPointer_getservent_r(struct servent *restrict result_buf, char *restrict buf, size_t buflen, struct servent **restrict result)
5062
{
5163
// cppcheck-suppress nullPointer

0 commit comments

Comments
 (0)