commit 760a97b7a87c9de2ed02f89fba5319f880573652
parent 4b2a9917e3ec7526fabc5af45ffb7fee72aca398
Author: Bor Grošelj Simić <bor.groseljsimic@telemach.net>
Date: Mon, 15 Mar 2021 19:32:57 +0100
check.c: fix usage of stdarg macros
POSIX requires every call to va_start be matched with a va_end call.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/check.c b/src/check.c
@@ -73,8 +73,12 @@ error(const struct location loc,
va_list ap;
va_start(ap, fmt);
size_t sz = vsnprintf(NULL, 0, fmt, ap);
+ va_end(ap);
char *msg = xcalloc(1, sz + 1);
+ va_start(ap, fmt);
vsnprintf(msg, sz + 1, fmt, ap);
+ va_end(ap);
+
struct errors *next = xcalloc(1, sizeof(struct errors));
next->loc = loc;