Fix log size calculation which caused message truncation.

Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2010-04-16 06:49:12 +00:00
parent 09398e9bd4
commit 20ec52dc4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=206697

View File

@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debuglevel, int error, const char *fmt,
len = snprintf(log, sizeof(log), "%s", pjdlog_prefix);
if ((size_t)len < sizeof(log))
len = vsnprintf(log + len, sizeof(log) - len, fmt, ap);
len += vsnprintf(log + len, sizeof(log) - len, fmt, ap);
if (error != -1 && (size_t)len < sizeof(log)) {
(void)snprintf(log + len, sizeof(log) - len, ": %s.",
strerror(error));