From: Jeff King Date: Thu, 30 May 2024 06:39:56 +0000 (-0400) Subject: t-strvec: mark variable-arg helper with LAST_ARG_MUST_BE_NULL X-Git-Tag: v2.46.0-rc0~69^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34eb843721bb3cd54e5fd1689d8f62bbba619bd9;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/unit-tests/t-strvec.c b/t/unit-tests/t-strvec.c index 6c1465ee61..d4615ab06d 100644 --- a/t/unit-tests/t-strvec.c +++ b/t/unit-tests/t-strvec.c @@ -4,6 +4,7 @@ #define check_strvec(vec, ...) \ check_strvec_loc(TEST_LOCATION(), vec, __VA_ARGS__) +LAST_ARG_MUST_BE_NULL static void check_strvec_loc(const char *loc, struct strvec *vec, ...) { va_list ap;