correct vsnprintf for log_plus

connection_manager
yuqing 2018-08-16 18:24:30 +08:00
parent 811ee077f1
commit 430c92c88f
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ void log_plus(const int priority, const char* file,
va_start(ap, fmt);
hlen += vsnprintf(buf+hlen, sizeof(buf)-hlen, fmt, ap);
va_end(ap);
if (hlen >= sizeof(buf)) {
hlen = sizeof(buf) - 1;
}
log_it_ex1(&g_log_context, priority, buf, hlen);
}