{
int j_type, idx, len;
int *int_data;
+ const char *src = NULL;
muse_return_val_if_fail(obj, FALSE);
muse_return_val_if_fail(data, FALSE);
case json_type_object:
break;
case json_type_string:
- strncpy((char *)data, json_object_get_string(obj), strlen(json_object_get_string(obj)));
+ src = json_object_get_string(obj);
+ muse_return_val_if_fail(src, FALSE);
+ g_strlcpy((gchar *)data, src, MUSE_MSG_MAX_LENGTH);
break;
case json_type_array:
int_data = (int *)data;
ep_fd = connection->epfd;
- do { /* We have to execute epoll_wait again in case of error of EINTR */
+ do { /* We have to execute epoll_wait again in case of error of EINTR */
gettimeofday(&tv_s, NULL);
fd_count = epoll_wait(ep_fd, connection->events, MS_EVENT_MAX, MS_TIMEOUT_MSEC);
if (fd_count < 0) {