Rename C++ header files to .hpp
[lttng-tools.git] / src / common / channel.cpp
index c0a0299a4d4a31302dbb08e977f2a01ea573b61b..be3b62343ec447bdb45b619a79452e55e0796772 100644 (file)
@@ -5,18 +5,16 @@
  *
  */
 
-#include <common/macros.h>
+#include <common/buffer-view.hpp>
+#include <common/dynamic-array.hpp>
+#include <common/dynamic-buffer.hpp>
+#include <common/error.hpp>
+#include <common/macros.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <lttng/channel-internal.hpp>
 #include <lttng/channel.h>
 #include <lttng/constant.h>
-#include <lttng/channel-internal.h>
-#include <lttng/userspace-probe-internal.h>
-#include <common/dynamic-buffer.h>
-#include <common/error.h>
-#include <assert.h>
-#include <string.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/dynamic-array.h>
-#include <common/buffer-view.h>
+#include <lttng/userspace-probe-internal.hpp>
 
 static enum lttng_error_code flatten_lttng_channels(
                struct lttng_dynamic_pointer_array *channels,
@@ -146,11 +144,6 @@ ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view,
                                lttng_buffer_view_from_view(view, offset,
                                                channel_comm->name_len);
 
-               if (channel_comm->name_len > LTTNG_SYMBOL_NAME_LEN - 1) {
-                       ret = -1;
-                       goto end;
-               }
-
                name = name_view.data;
                if (!lttng_buffer_view_contains_string(
                                    &name_view, name, channel_comm->name_len)) {
@@ -158,7 +151,12 @@ ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view,
                        goto end;
                }
 
-               strcpy(local_channel->name, name);
+               ret = lttng_strncpy(local_channel->name, name,
+                               sizeof(local_channel->name));
+               if (ret) {
+                       goto end;
+               }
+
                offset += channel_comm->name_len;
        }
 
This page took 0.026044 seconds and 4 git commands to generate.