0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Small correction to va_start/va_end in cli_printf (va_end was missing).

(Andreas)
This commit is contained in:
Martin Mares 2004-05-31 18:08:50 +00:00
parent 5f2a6a9ff3
commit 277a34eff1

View File

@ -110,7 +110,6 @@ cli_printf(cli *c, int code, char *msg, ...)
int cd = code; int cd = code;
int size, cnt; int size, cnt;
va_start(args, msg);
if (cd < 0) if (cd < 0)
{ {
cd = -cd; cd = -cd;
@ -122,7 +121,9 @@ cli_printf(cli *c, int code, char *msg, ...)
else else
size = bsprintf(buf, "%04d ", cd); size = bsprintf(buf, "%04d ", cd);
c->last_reply = cd; c->last_reply = cd;
va_start(args, msg);
cnt = bvsnprintf(buf+size, sizeof(buf)-size-1, msg, args); cnt = bvsnprintf(buf+size, sizeof(buf)-size-1, msg, args);
va_end(args);
if (cnt < 0) if (cnt < 0)
{ {
cli_printf(c, code < 0 ? -8000 : 8000, "<line overflow>"); cli_printf(c, code < 0 ? -8000 : 8000, "<line overflow>");