Fix freebsd endian support
[lttng-ust.git] / liblttng-ust / ltt-events.c
index 82a1119cb3d8aa1e8a1891b3e779a88bbd181c93..775e73cad828f5119a8b3275b4f86470d55d07b9 100644 (file)
@@ -22,7 +22,6 @@
 
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <endian.h>
 #include <urcu/list.h>
 #include <urcu/hlist.h>
 #include <pthread.h>
@@ -35,6 +34,7 @@
 #include <inttypes.h>
 #include <time.h>
 #include <sys/prctl.h>
+#include <lttng/ust-endian.h>
 #include "clock.h"
 
 #include <urcu-bp.h>
@@ -248,9 +248,10 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc)
 
                                memcpy(&event_param, &sw->event_param,
                                                sizeof(event_param));
-                               memcpy(event_param.name,
+                               strncpy(event_param.name,
                                        desc->name,
                                        sizeof(event_param.name));
+                               event_param.name[sizeof(event_param.name) - 1] = '\0';
                                /* create event */
                                ret = ltt_event_create(sw->chan,
                                        &event_param, NULL,
This page took 0.02318 seconds and 4 git commands to generate.