Fix: utils: utils_stream_file_path separator
[lttng-tools.git] / src / common / utils.c
index 17a313ee16f66efe8c574ddfddc8f94f156b9e11..22fd33ea3f1a09e6fda886d242b686731adda8ae 100644 (file)
@@ -742,7 +742,8 @@ int utils_stream_file_path(const char *path_name, const char *file_name,
         char count_str[MAX_INT_DEC_LEN(count) + 1] = {};
        const char *path_separator;
 
-       if (path_name && path_name[strlen(path_name) - 1] == '/') {
+       if (path_name && (path_name[0] == '\0' ||
+                       path_name[strlen(path_name) - 1] == '/')) {
                path_separator = "";
        } else {
                path_separator = "/";
This page took 0.023764 seconds and 4 git commands to generate.