diff options
| author | Jeff King <peff@peff.net> | 2024-05-30 02:39:56 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-30 08:55:29 -0700 |
| commit | 34eb843721bb3cd54e5fd1689d8f62bbba619bd9 (patch) | |
| tree | 086a79743d467f951b97e92ec571d0402090a342 /t/unit-tests | |
| parent | b639884f9ac78325b9a6658f23c9c245b8ac8263 (diff) | |
| download | git-34eb843721bb3cd54e5fd1689d8f62bbba619bd9.tar.gz | |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
| -rw-r--r-- | t/unit-tests/t-strvec.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |
