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:
parent
09398e9bd4
commit
20ec52dc4b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=206697
@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debuglevel, int error, const char *fmt,
|
|||||||
|
|
||||||
len = snprintf(log, sizeof(log), "%s", pjdlog_prefix);
|
len = snprintf(log, sizeof(log), "%s", pjdlog_prefix);
|
||||||
if ((size_t)len < sizeof(log))
|
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)) {
|
if (error != -1 && (size_t)len < sizeof(log)) {
|
||||||
(void)snprintf(log + len, sizeof(log) - len, ": %s.",
|
(void)snprintf(log + len, sizeof(log) - len, ": %s.",
|
||||||
strerror(error));
|
strerror(error));
|
||||||
|
Loading…
Reference in New Issue
Block a user