Run clang-format on the whole tree
[lttng-tools.git] / src / common / context.cpp
index a4111ad9002e9a29fcd073b4b4c6f93b41041040..b85a39abd92f6a19c53ef60e2bb3c7e2d0e77990 100644 (file)
@@ -6,13 +6,14 @@
  */
 
 #include "context.hpp"
-#include <stddef.h>
-#include <string.h>
+
 #include <common/error.hpp>
 #include <common/macros.hpp>
 
-int parse_application_context(const char *str, char **out_provider_name,
-               char **out_ctx_name)
+#include <stddef.h>
+#include <string.h>
+
+int parse_application_context(const char *str, char **out_provider_name, char **out_ctx_name)
 {
        const char app_ctx_prefix[] = "$app.";
        char *provider_name = NULL, *ctx_name = NULL;
@@ -46,8 +47,7 @@ int parse_application_context(const char *str, char **out_provider_name,
         * No colon found or no ctx name ("$app.provider:") or no provider name
         * given ("$app.:..."), which is invalid.
         */
-       if (!colon_pos || colon_pos == len ||
-                       colon_pos == sizeof(app_ctx_prefix)) {
+       if (!colon_pos || colon_pos == len || colon_pos == sizeof(app_ctx_prefix)) {
                goto not_found;
        }
 
@@ -57,8 +57,7 @@ int parse_application_context(const char *str, char **out_provider_name,
                PERROR("malloc provider_name");
                goto not_found;
        }
-       strncpy(provider_name, str + sizeof(app_ctx_prefix) - 1,
-                       provider_name_len - 1);
+       strncpy(provider_name, str + sizeof(app_ctx_prefix) - 1, provider_name_len - 1);
 
        ctx_name_len = len - colon_pos;
        ctx_name = calloc<char>(ctx_name_len);
@@ -76,4 +75,3 @@ not_found:
        free(ctx_name);
        return -1;
 }
-
This page took 0.024326 seconds and 4 git commands to generate.