net->rssi = _src->rssi;
net->data_rate = _src->data_rate;
net->security = _src->security;
- if (_src->passphrase)
+ if (strlen(_src->passphrase) > 0)
snprintf(net->passphrase, MAX_PASSPHRASE_LEN, "%s", _src->passphrase);
*dst = (mesh_network_h)net;
gchar *name_owner = g_dbus_proxy_get_name_owner(proxy);
mesh_h handle = (mesh_h)user_data;
+ LOGD("Name owner notify [%s]", name_owner);
+
if (name_owner)
return;
- LOGE("name_owner is not exists !");
- _mesh_close_gdbus_call(handle);
+ if (NULL == name_owner)
+ _mesh_close_gdbus_call(handle);
+
+ g_free(name_owner);
}
static int _mesh_create_gdbus_call(mesh_h handle)
snprintf(buf, 255, "%s%04X: ", pad, 0);
for (i = 0; i < size; i++) {
snprintf(hex, 4, "%02X ", p[i]);
- strncat(buf, hex, strlen(hex));
+ strncat(buf, hex, 255 - strlen(buf) - 1);
if ((i + 1) % 8 == 0) {
if ((i + 1) % 16 == 0) {
memset(buf, 0, 255);
snprintf(buf, 255, "%s%04X: ", pad, i + 1);
} else {
- strncat(buf, TAB_SPACE, strlen(TAB_SPACE));
+ strncat(buf, TAB_SPACE, 255 - strlen(buf) - 1);
}
}
}