Skip to content

Commit b639884

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a3f0e2a commit b639884

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/unit-tests/t-strvec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ static void check_strvec_loc(const char *loc, struct strvec *vec, ...)
2222
strbuf_addf(&msg, "strvec index %"PRIuMAX, (uintmax_t) nr);
2323
test_assert(loc, msg.buf, 0);
2424
strbuf_release(&msg);
25+
va_end(ap);
2526
return;
2627
}
2728

2829
nr++;
2930
}
31+
va_end(ap);
3032

3133
check_uint(vec->nr, ==, nr);
3234
check_uint(vec->alloc, >=, nr);

0 commit comments

Comments
 (0)