0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-12 21:06:22 +00:00

Testing: Don't call vsnprintf with NULL format

This commit is contained in:
Maria Matejka 2019-09-30 13:53:24 +02:00 committed by Maria Matejka
parent 24493e9169
commit c41a914d6e

View File

@ -199,7 +199,8 @@ bt_log_result(int result, const char *fmt, va_list argptr)
(fmt && strlen(fmt) > 0) ? ": " : "");
pos = msg_buf + strlen(msg_buf);
vsnprintf(pos, sizeof(msg_buf) - (pos - msg_buf), fmt, argptr);
if (fmt)
vsnprintf(pos, sizeof(msg_buf) - (pos - msg_buf), fmt, argptr);
int chrs = 0;
for (uint i = 0; i < strlen(msg_buf); i += get_num_terminal_cols())