diff options
author | pjd <pjd@FreeBSD.org> | 2010-04-16 06:49:12 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-04-16 06:49:12 +0000 |
commit | 1181490d6c335d7f89bb15d882bc234f3ea443bd (patch) | |
tree | eed3aed2d48e845094499f3ee751f944d48ffdac /sbin/hastd/pjdlog.c | |
parent | 9358f8fa2bf12f2573f2cecbd354d97233801d49 (diff) | |
download | FreeBSD-src-1181490d6c335d7f89bb15d882bc234f3ea443bd.zip FreeBSD-src-1181490d6c335d7f89bb15d882bc234f3ea443bd.tar.gz |
Fix log size calculation which caused message truncation.
Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days
Diffstat (limited to 'sbin/hastd/pjdlog.c')
-rw-r--r-- | sbin/hastd/pjdlog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/hastd/pjdlog.c b/sbin/hastd/pjdlog.c index 38c5539..9f8b3f4 100644 --- a/sbin/hastd/pjdlog.c +++ b/sbin/hastd/pjdlog.c @@ -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)); |