afb-ditf: use NULL function feature
[src/app-framework-binder.git] / src / afb-ditf.c
index 28cd46a..63268a8 100644 (file)
@@ -46,7 +46,7 @@ static void vverbose_cb(void *closure, int level, const char *file, int line, co
        char *p;
        struct afb_ditf *ditf = closure;
 
-       if (vasprintf(&p, fmt, args) < 0)
+       if (!fmt || vasprintf(&p, fmt, args) < 0)
                vverbose(level, file, line, function, fmt, args);
        else {
                verbose(level, file, line, function, "[API %s] %s", ditf->api, p);
@@ -56,7 +56,7 @@ static void vverbose_cb(void *closure, int level, const char *file, int line, co
 
 static void old_vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args)
 {
-       vverbose_cb(closure, level, file, line, "?", fmt, args);
+       vverbose_cb(closure, level, file, line, NULL, fmt, args);
 }
 
 static struct afb_event event_make_cb(void *closure, const char *name)
@@ -152,7 +152,7 @@ static void hooked_vverbose_cb(void *closure, int level, const char *file, int l
 
 static void hooked_old_vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args)
 {
-       hooked_vverbose_cb(closure, level, file, line, "?", fmt, args);
+       hooked_vverbose_cb(closure, level, file, line, NULL, fmt, args);
 }
 
 static struct afb_event hooked_event_make_cb(void *closure, const char *name)