commit b6073c33a91a931906e4ca1d0391dce2b5620191
parent ee8066d660328b66ee556ed51a596d3701e5d467
Author: hhvn <dev@hhvn.uk>
Date: Tue, 12 Apr 2022 17:42:24 +0100
va_list can only reliably be used once without another va_start()
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/ui.c b/src/ui.c
@@ -643,7 +643,10 @@ ui_wprintc(struct Window *window, int lines, char *format, ...) {
va_start(ap, format);
ret = vsnprintf(str, 0, format, ap) + 1;
+ va_end(ap);
str = emalloc(ret);
+
+ va_start(ap, format);
ret = vsnprintf(str, ret, format, ap);
va_end(ap);
if (ret < 0)