accept NULL for log function fmt arg
authorTero Marttila <terom@fixme.fi>
Thu, 21 May 2009 16:55:56 +0300
changeset 209 d240da5dbeb5
parent 208 4c834d48e602
child 210 05abca972db0
accept NULL for log function fmt arg
src/log.c
--- a/src/log.c	Thu May 21 16:24:52 2009 +0300
+++ b/src/log.c	Thu May 21 16:55:56 2009 +0300
@@ -85,7 +85,8 @@
     buf_ptr += str_advance(NULL, &buf_size, str_append_fmt(buf_ptr, buf_size, "[%5s] %20s : ", tag, func));
     
     // output the user data
-    buf_ptr += str_advance(NULL, &buf_size, str_append_fmt_va(buf_ptr, buf_size, user_fmt, user_fmtargs));
+    if (user_fmt)
+        buf_ptr += str_advance(NULL, &buf_size, str_append_fmt_va(buf_ptr, buf_size, user_fmt, user_fmtargs));
     
     // output the suffix
     if (log_fmt) {