Commit 5918a9e1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use bprintf() into static buffers to get overflow assert.

Whitespace nits



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5099 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 98f8202e
......@@ -60,7 +60,8 @@ static struct vcc_dir_backend_defaults {
unsigned saint;
} b_defaults;
static void vcc_dir_initialize_defaults(void)
static void
vcc_dir_initialize_defaults(void)
{
b_defaults.port = NULL;
b_defaults.hostheader = NULL;
......@@ -83,16 +84,17 @@ print_backend(struct vcc *tl,
struct token tmptok;
struct vsb *vsb;
sprintf(strip, "%u.%u.%u.%u", ip[3], ip[2], ip[1], ip[0]);
bprintf(strip, "%u.%u.%u.%u", ip[3], ip[2], ip[1], ip[0]);
tmptok.dec = strip;
sprintf(vgcname,"%.*s_%d",PF(tl->t_dir), serial);
bprintf(vgcname, "%.*s_%d", PF(tl->t_dir), serial);
vsb = vsb_newauto();
AN(vsb);
tl->fb = vsb;
Fc(tl, 0, "\t{ .host = VGC_backend_%s },\n",vgcname);
Fh(tl, 1, "\n#define VGC_backend_%s %d\n", vgcname, serial);
Fb(tl, 0, "\nstatic const struct vrt_backend vgc_dir_priv_%s = {\n", vgcname);
Fb(tl, 0, "\nstatic const struct vrt_backend vgc_dir_priv_%s = {\n",
vgcname);
Fb(tl, 0, "\t.vcl_name = \"%.*s", PF(tl->t_dir));
if (serial >= 0)
......@@ -308,7 +310,8 @@ vcc_ParseDnsDirector(struct vcc *tl)
vcc_ParseBackendHost(tl, nelem, &p);
ERRCHK(tl);
AN(p);
Fc(tl, 0, "%s .host = VGC_backend_%s", first, p);
Fc(tl, 0, "%s .host = VGC_backend_%s",
first, p);
} else {
ErrInternal(tl);
}
......@@ -316,8 +319,8 @@ vcc_ParseDnsDirector(struct vcc *tl)
}
vcc_FieldsOk(tl, fs);
if (tl->err) {
vsb_printf(tl->sb,
"\nIn member host specification starting at:\n");
vsb_printf(tl->sb, "\nIn member host"
" specification starting at:\n");
vcc_ErrWhere(tl, t_be);
return;
}
......@@ -340,8 +343,7 @@ vcc_ParseDnsDirector(struct vcc *tl)
vcc_NextToken(tl);
}
Fc(tl, 0, "};\n");
Fc(tl, 0,
"\nstatic const struct vrt_dir_dns vgc_dir_priv_%.*s = {\n",
Fc(tl, 0, "\nstatic const struct vrt_dir_dns vgc_dir_priv_%.*s = {\n",
PF(tl->t_dir));
Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(tl->t_dir));
Fc(tl, 0, "\t.nmember = %d,\n", nelem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment