#include <cpacket.h>
#include <sensor_common.h>
-#define COMMAND_CHANNEL_PATH "/tmp/sensord_command_socket"
-#define EVENT_CHANNEL_PATH "/tmp/sensord_event_socket"
+#define COMMAND_CHANNEL_PATH "/tmp/sensord_command_socket\0"
+#define EVENT_CHANNEL_PATH "/tmp/sensord_event_socket\0"
#define MAX_HANDLE 256
#define MAX_HANDLE_REACHED -2
m_addr.sun_family = AF_UNIX;
- strncpy(m_addr.sun_path, sock_path, sizeof(m_addr.sun_path));
- m_addr.sun_path[sizeof(m_addr.sun_path)-1] = '\0';
+ strncpy(m_addr.sun_path, sock_path, strlen(sock_path));
length = strlen(m_addr.sun_path) + sizeof(m_addr.sun_family);
m_addr.sun_family = AF_UNIX;
- strncpy(m_addr.sun_path, sock_path, sizeof(m_addr.sun_path));
- m_addr.sun_path[sizeof(m_addr.sun_path)-1] = '\0';
+ strncpy(m_addr.sun_path, sock_path, strlen(sock_path));
addr_len = strlen(m_addr.sun_path) + sizeof(m_addr.sun_family);