strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
- ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
- object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1);
- object_info->part_state = calloc(1, strlen(ret) + 1);
- if (!object_info->part_name || !object_info->part_state) {
- VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ object_info->part_name = strdup(edje_info->part_name);
+ if (!object_info->part_name) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory for part_name");
goto exit;
}
- strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
- strncpy(object_info->part_state, ret, strlen(ret) + 1);
+
+ ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
+ if (ret) {
+ object_info->part_state = strdup(ret);
+ if (!object_info->part_state) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ goto exit;
+ }
+ } else {
+ VC_ELM_LOG_INFO("[INFO] Fail to get state, return value is NULL");
+ }
if (edje_info->image_name) {
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);
strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
- ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
- object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1);
- object_info->part_state = calloc(1, strlen(ret) + 1);
- if (!object_info->part_name || !object_info->part_state) {
- VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ object_info->part_name = strdup(edje_info->part_name);
+ if (!object_info->part_name) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory for part_name");
goto exit;
}
- strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
- strncpy(object_info->part_state, ret, strlen(ret) + 1);
+
+ ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
+ if (ret) {
+ object_info->part_state = strdup(ret);
+ if (!object_info->part_state) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ goto exit;
+ }
+ } else {
+ VC_ELM_LOG_INFO("[INFO] Fail to get state, return value is NULL");
+ }
if (edje_info->image_name) {
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);