Commit 189b65d6 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Evict the last *asprintf usage.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4580 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7ac9957e
......@@ -208,10 +208,10 @@ static struct cli_proto cli_askchild[] = {
int
mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) {
char *p;
int i, j;
va_list ap;
unsigned u;
char buf[params->cli_buffer], *p;
if (resp != NULL)
*resp = NULL;
......@@ -223,13 +223,12 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) {
return (CLIS_CANT);
}
va_start(ap, fmt);
i = vasprintf(&p, fmt, ap);
vbprintf(buf, fmt, ap);
va_end(ap);
if (i < 0)
return (i);
assert(p[i - 1] == '\n');
j = write(cli_o, p, i);
free(p);
p = strchr(buf, '\0');
assert(p != NULL && p > buf && p[-1] == '\n');
i = p - buf;
j = write(cli_o, buf, i);
if (j != i) {
if (status != NULL)
*status = CLIS_COMMS;
......
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