summaryrefslogtreecommitdiff
path: root/test/birdtest.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-09-30 13:53:24 +0200
committerMaria Matejka <mq@jmq.cz>2019-10-04 20:52:07 +0200
commitc41a914d6e9be91cda40c7e7c05a8b4f2b515089 (patch)
treeb5a386b58c7fee17b7c4a25ee8e0904291f8ace2 /test/birdtest.c
parent24493e9169d3058958ab3ec4d2b02c5753954981 (diff)
Testing: Don't call vsnprintf with NULL format
Diffstat (limited to 'test/birdtest.c')
-rw-r--r--test/birdtest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index 484205d2..9f7ab583 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -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())