Extend API and remove lttng_uri from lttng.h
[lttng-tools.git] / src / common / utils.c
index bc9b2db3fcc0caf379464b271d22b570f115d9e0..0494b23bdcd0bd356f45c0f4f8c5bf8a0f99c871 100644 (file)
@@ -154,3 +154,23 @@ void utils_close_pipe(int *src)
                }
        }
 }
+
+/*
+ * Create a new string using two strings range.
+ */
+char *utils_strdupdelim(const char *begin, const char *end)
+{
+       char *str;
+
+       str = zmalloc(end - begin + 1);
+       if (str == NULL) {
+               PERROR("zmalloc strdupdelim");
+               goto error;
+       }
+
+       memcpy(str, begin, end - begin);
+       str[end - begin] = '\0';
+
+error:
+       return str;
+}
This page took 0.022799 seconds and 4 git commands to generate.