Fix for truncated last character on long logged lines.

This commit is contained in:
James Canete
2008-02-21 22:45:21 +00:00
parent dd86aedd19
commit 001e8ec674

View File

@@ -154,7 +154,7 @@ void xmpp_log(const xmpp_ctx_t * const ctx,
return;
}
oldret = ret;
ret = xmpp_vsnprintf(buf, ret, fmt, ap);
ret = xmpp_vsnprintf(buf, ret + 1, fmt, ap);
if (ret > oldret) {
xmpp_error(ctx, "log", "Unexpected error");
return;