info_start = strstr(buf, "bluetooth");
if (info_start == NULL) {
- BT_ERR("strstr() error(%s)", info_start);
+ BT_ERR("strstr() error info_start is NULL");
ret = BT_ERROR_OPERATION_FAILED;
goto ERROR;
}
info_start += 10;
info_end = strstr(buf, "hcd");
if (info_end == NULL) {
- BT_ERR("strstr() error(%s)", info_end);
+ BT_ERR("strstr() error info_end is NULL");
ret = BT_ERROR_OPERATION_FAILED;
goto ERROR;
}
info_end = strchr(buf, '_');
if (info_end == NULL) {
- BT_ERR("strchr() error(%s)", info_end);
+ BT_ERR("strchr() error info_end is NULL");
ret = BT_ERROR_OPERATION_FAILED;
goto ERROR;
}
info_start = buf;
info_end = strchr(buf, ',');
if (info_end == NULL) {
- BT_ERR("strchr() error(%s)", info_end);
+ BT_ERR("strchr() error info_end is NULL");
ret = BT_ERROR_OPERATION_FAILED;
goto ERROR;
}
if (param_index > 0) {
int len = strlen(param);
- g_test_param.params[param_index - 1] = g_malloc0(len + 1);
/* Remove new line character */
param[len - 1] = '\0';
- strncpy(g_test_param.params[param_index - 1], param, strlen(param));
+ g_test_param.params[param_index - 1] = g_strdup(param);
}
if (param_index == g_test_param.param_count) {