mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Complain loudly if the logging buffer would overflow.
This commit is contained in:
parent
53a416d376
commit
9158ca99f7
@ -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);
|
||||
else
|
||||
fprintf(stderr, "BIRD: warning: logging buffer overflow!\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user