summaryrefslogtreecommitdiffstats
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-11-16 22:41:21 +0100
committerMartin Mares <mj@ucw.cz>1998-11-16 22:41:21 +0100
commit9158ca99f740d5b1b50d233e0f64e61504dc6fdf (patch)
tree933f73173115d47e32adaa9fedeea3f4d0856473 /sysdep/unix/log.c
parent53a416d376a16b2091dce898a16600b0cd27c348 (diff)
downloadbird-9158ca99f740d5b1b50d233e0f64e61504dc6fdf.tar
bird-9158ca99f740d5b1b50d233e0f64e61504dc6fdf.zip
Complain loudly if the logging buffer would overflow.
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index b9077c7..00589a3 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -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