[master] e9e4aa4 Fix for an off-by-one issue in do_once_cb().

Dag Haavi Finstad daghf at varnish-cache.org
Mon Jun 18 13:07:40 CEST 2012


commit e9e4aa46214c17eab5839f7305626d85551f5702
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Mon Jun 18 12:58:08 2012 +0200

    Fix for an off-by-one issue in do_once_cb().
    
    Fixes: #1133

diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
index 859c379..47cee40 100644
--- a/bin/varnishstat/varnishstat.c
+++ b/bin/varnishstat/varnishstat.c
@@ -168,7 +168,7 @@ do_once_cb(void *priv, const struct VSC_point * const pt)
 	if (strcmp(pt->ident, ""))
 		i += printf("%s.", pt->ident);
 	i += printf("%s", pt->desc->name);
-	if (i > op->pad)
+	if (i >= op->pad)
 		op->pad = i + 1;
 	printf("%*.*s", op->pad - i, op->pad - i, "");
 	if (pt->desc->flag == 'a' || pt->desc->flag == 'c')



More information about the varnish-commit mailing list