Fix: utils: utils_stream_file_path separator
[lttng-tools.git] / src / common / utils.c
index f3cb9e0306e599a3b7aef48bce1812cfc7d6a03a..d79985a16ce601ba419b57b41374b018b062b48e 100644 (file)
@@ -744,7 +744,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.022686 seconds and 4 git commands to generate.