t-strvec: use va_end() to match va_start()
Our check_strvec_loc() helper uses a variable argument list. When we va_start(), we must be sure to va_end() before leaving the function. This is required by the standard (though the effect of forgetting will vary between platforms). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 30, 2024 at 02:39 UTC
b639884f9ac78325b9a6658f23c9c245b8ac8263
1 file changed
+2
t/unit-tests/t-strvec.c
+2
@@ -22,11 +22,13 @@ static void check_strvec_loc(const char *loc, struct strvec *vec, ...)
22
strbuf_addf(&msg, "strvec index %"PRIuMAX, (uintmax_t) nr);
23
test_assert(loc, msg.buf, 0);
24
strbuf_release(&msg);
25
+ va_end(ap);
26
return;
27
}
28
29
nr++;
30
}
31
+ va_end(ap);
32
33
check_uint(vec->nr, ==, nr);
34
check_uint(vec->alloc, >=, nr);