Commit 9158ca99 authored by Martin Mareš's avatar Martin Mareš

Complain loudly if the logging buffer would overflow.

parent 53a416d3
......@@ -50,8 +50,11 @@ bvfprintf(FILE *f, char *fmt, va_list args)
char buf[4096];
int n;
n = bvsprintf(buf, fmt, args);
fwrite(buf, n, sizeof(char), f);
n = bvsnprintf(buf, sizeof(buf), fmt, args);
if (n >= 0)
fwrite(buf, n, sizeof(char), f);
fprintf(stderr, "BIRD: warning: logging buffer overflow!\n");
static void
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