diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-05-12 21:29:04 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-05-12 21:44:27 +0200 |
commit | 3f2c7600fa2e35b1028c755aa06092b5991e1a8e (patch) | |
tree | 3c63bcea68883d1065ab1abdfbe3ebdbab250cf3 /client/util.c | |
parent | 8e433d6a529a883d566dc1d5a4afe0f1e2750baf (diff) |
We don't need bvsnprintf() in BIRD client
Diffstat (limited to 'client/util.c')
-rw-r--r-- | client/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/util.c b/client/util.c index 050224b9..c35cf8f4 100644 --- a/client/util.c +++ b/client/util.c @@ -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); } |