[master] a39c931f1 vcurses: defuse assertions on *printw()

Nils Goroll nils.goroll at uplex.de
Fri Feb 7 22:37:05 UTC 2025


commit a39c931f15c8052b0ea7a54f99bd5ea2f08f46a5
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Feb 7 23:34:02 2025 +0100

    vcurses: defuse assertions on *printw()
    
    7af00146975db17247b7602b0dfce3ccf8090245 accidentally enabled previous AC()
    checks for varnishtop only.
    
    *printw() is buggy, see #4266

diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index 3022cb025..e9cdae6de 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -210,16 +210,16 @@ update(unsigned p)
 	q = ident;
 	len = COLS - strlen(q);
 	if (end_of_file)
-		AC(mvprintw(0, len - (1 + 6), "%s (EOF)", q));
+		IC(mvprintw(0, len - (1 + 6), "%s (EOF)", q));
 	else
-		AC(mvprintw(0, len - 1, "%s", q));
-	AC(mvprintw(0, 0, "list length %u", ntop));
+		IC(mvprintw(0, len - 1, "%s", q));
+	IC(mvprintw(0, 0, "list length %u", ntop));
 	for (tp = VRBT_MIN(t_order, &h_order); tp != NULL; tp = tp2) {
 		tp2 = VRBT_NEXT(t_order, &h_order, tp);
 
 		if (++l < LINES) {
 			len = vmin(tp->clen, COLS - 20);
-			AC(mvprintw(l, 0, "%9.2f %-*.*s %*.*s\n",
+			IC(mvprintw(l, 0, "%9.2f %-*.*s %*.*s\n",
 				tp->count, maxfieldlen, maxfieldlen,
 				VSL_tags[tp->tag],
 				len, len, tp->rec_data));


More information about the varnish-commit mailing list