Skip to content

Commit 34eb843

Browse files
peffgitster
authored andcommitted
t-strvec: mark variable-arg helper with LAST_ARG_MUST_BE_NULL
This will let the compiler catch a problem like: /* oops, we forgot the NULL */ check_strvec(&vec, "foo"); rather than triggering undefined behavior at runtime. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b639884 commit 34eb843

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/unit-tests/t-strvec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#define check_strvec(vec, ...) \
66
check_strvec_loc(TEST_LOCATION(), vec, __VA_ARGS__)
7+
LAST_ARG_MUST_BE_NULL
78
static void check_strvec_loc(const char *loc, struct strvec *vec, ...)
89
{
910
va_list ap;

0 commit comments

Comments
 (0)