Fix trace-collection.h: No such file or directory that build code with libbabeltrace
[babeltrace.git] / lib / registry.c
index 829ede9da77bf12dce5da544e3ea0bb3538a8049..3cef63d93cb0966b783819b6e402201303062ab1 100644 (file)
@@ -44,6 +44,7 @@ struct format *bt_lookup_format(bt_intern_str name)
 {
        if (!init_done)
                return NULL;
+
        return g_hash_table_lookup(format_registry,
                                   (gconstpointer) (unsigned long) name);
 }
@@ -61,6 +62,8 @@ void bt_fprintf_format_list(FILE *fp)
 {
        struct walk_data data;
 
+       assert(fp);
+
        data.fp = fp;
        data.iter = 0;
 
@@ -75,6 +78,9 @@ void bt_fprintf_format_list(FILE *fp)
 
 int bt_register_format(struct format *format)
 {
+       if (!format)
+               return -EINVAL;
+
        if (!init_done)
                format_init();
 
This page took 0.030752 seconds and 4 git commands to generate.