]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - client/util.c
We don't need bvsnprintf() in BIRD client
[thirdparty/bird.git] / client / util.c
index 050224b97775b8b245771247227fd3101c2ca409..c35cf8f432e75324772036e6f95ba6018ac03c37 100644 (file)
@@ -21,8 +21,11 @@ vlog(const char *msg, va_list args)
 {
   char buf[1024];
 
-  if (bvsnprintf(buf, sizeof(buf)-1, msg, args) < 0)
-    bsprintf(buf + sizeof(buf) - 100, " ... <too long>");
+  int n = vsnprintf(buf, sizeof(buf), msg, args);
+  if (n < 0)
+    snprintf(buf, sizeof(buf), "???");
+  if (n >= sizeof(buf))
+    snprintf(buf + sizeof(buf) - 100, 100, " ... <too long>");
   fputs(buf, stderr);
   fputc('\n', stderr);
 }