summaryrefslogtreecommitdiff
path: root/client/util.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-12 21:47:50 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-12 21:49:52 +0200
commitb66a9e2f3376b4cb07ef4cc318f70a9c794f407a (patch)
treec4f7ef483ec2d2c7bac4f605d2aed0b3ab7b738d /client/util.c
parent659f80f262a83d600d5f095fb8a03e912d3fbe64 (diff)
parent3f2c7600fa2e35b1028c755aa06092b5991e1a8e (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'client/util.c')
-rw-r--r--client/util.c7
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);
}