*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <common/common.h>
#include <common/defaults.h>
+#include <common/compat/endian.h>
#include <common/sessiond-comm/relayd.h>
#include <common/index/ctf-index.h>
int ret;
struct lttcomm_relayd_create_session_2_4 msg;
- strncpy(msg.session_name, session_name, sizeof(msg.session_name));
- strncpy(msg.hostname, hostname, sizeof(msg.hostname));
+ if (lttng_strncpy(msg.session_name, session_name,
+ sizeof(msg.session_name))) {
+ ret = -1;
+ goto error;
+ }
+ if (lttng_strncpy(msg.hostname, hostname, sizeof(msg.hostname))) {
+ ret = -1;
+ goto error;
+ }
msg.live_timer = htobe32(session_live_timer);
msg.snapshot = htobe32(snapshot);