Fix: assign the current clock for mmap traces
[babeltrace.git] / lib / context.c
index 373944c20c2144fd0e0d0ab20a56578f635cc641..e2c1739c41ff548a21ae13a3e62f983779590e5b 100644 (file)
@@ -104,8 +104,10 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
        }
        handle->format = fmt;
        handle->td = td;
-       strncpy(handle->path, path, PATH_MAX);
-       handle->path[PATH_MAX - 1] = '\0';
+       if (path) {
+               strncpy(handle->path, path, PATH_MAX);
+               handle->path[PATH_MAX - 1] = '\0';
+       }
 
        if (fmt->set_handle)
                fmt->set_handle(td, handle);
This page took 0.022509 seconds and 4 git commands to generate.