]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Testing: Don't call vsnprintf with NULL format
authorMaria Matejka <mq@ucw.cz>
Mon, 30 Sep 2019 11:53:24 +0000 (13:53 +0200)
committerMaria Matejka <mq@jmq.cz>
Fri, 4 Oct 2019 18:52:07 +0000 (20:52 +0200)
test/birdtest.c

index 484205d239030ebe6b590af44e8c93028d77de06..9f7ab5832c02be054e5d59bcad2352982958917e 100644 (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())