[master] 73629964c Allocate VSB the canonical way

Poul-Henning Kamp phk at FreeBSD.org
Wed Aug 12 12:07:08 UTC 2020


commit 73629964ce15485619b48b9d3550ac449a7f48ef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 12 08:36:04 2020 +0000

    Allocate VSB the canonical way

diff --git a/bin/varnishstat/varnishstat_help_gen.c b/bin/varnishstat/varnishstat_help_gen.c
index 2b145bed3..1412ea992 100644
--- a/bin/varnishstat/varnishstat_help_gen.c
+++ b/bin/varnishstat/varnishstat_help_gen.c
@@ -45,11 +45,12 @@ static const char help[] = "\n\n"
 int
 main(void)
 {
-	struct vsb vsb[1];
+	struct vsb *vsb;
 	const char *p, *n;
 	unsigned u;
 
-	AN(VSB_new(vsb, NULL, 0, VSB_AUTOEXTEND));
+	vsb = VSB_new_auto();
+	AN(vsb);
 	VSB_cat(vsb,
 	    "/*\n"
 	    " * NB:  This file is machine generated, DO NOT EDIT!\n"
@@ -83,6 +84,6 @@ main(void)
 	    "const int bindings_help_len = %u;\n", u);
 	AZ(VSB_finish(vsb));
 	AZ(VSB_tofile(vsb, STDOUT_FILENO));
-	VSB_delete(vsb);
+	VSB_destroy(&vsb);
 	return (0);
 }


More information about the varnish-commit mailing list