return false;
}
- for (int i=0;i<tel_list.count;i++) {
+ for (int i = 0; i < tel_list.count; i++) {
ret_sim =
telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
&call_list_sim);
char *temp = (char *) calloc((word_len + 1), sizeof(char));
MP_CHECK_NULL(temp);
if (strlen(string) <= DEF_BUF_LEN) {
- strncpy(temp, string, strlen(string));
+ strncpy(temp, string, (strlen(string) + 1));
}
i = 0;
while (word_len > DEF_BUF_LEN) {
i++;
}
if (strlen(temp) <= DEF_BUF_LEN) {
- strncpy(pstr, temp, strlen(temp));
+ strncpy(pstr, temp, (strlen(temp) + 1));
}
IF_FREE(temp);
} else {
if (strlen(string) <= DEF_BUF_LEN) {
- strncpy(pstr, string, strlen(string));
+ strncpy(pstr, string, (strlen(string) + 1));
}
}
list_item_data_t *item_data =
(list_item_data_t *) elm_object_item_data_get(event_info);
+ MP_CHECK(item_data);
mp_media_info_h media = item_data->media;
MP_CHECK(media);
mp_media_info_group_get_main_info(media, &name);
count++;
}
}
- return count;
-
endfunc;
+ return count;
}
static void _gl_sel_cb(void *data, Evas_Object * obj, void *event_info)
while (item) {
list_item_data_t *it_data = elm_object_item_data_get(item);
-
- if (!it_data->checked) {
- all_selected = EINA_TRUE;
- break;
+ if (it_data != NULL) {
+ if (!it_data->checked) {
+ all_selected = EINA_TRUE;
+ break;
+ }
}
item = elm_genlist_item_next_get(item);
}
item = elm_genlist_first_item_get(ld->genlist);
while (item) {
list_item_data_t *it_data = elm_object_item_data_get(item);
+ if (it_data)
+ it_data->checked = all_selected;
- it_data->checked = all_selected;
elm_genlist_item_fields_update(item, "elm.edit.icon.1",
ELM_GENLIST_ITEM_FIELD_CONTENT);
item = elm_genlist_item_next_get(item);
char *title = NULL;
list_item_data_t *item_data = elm_object_item_data_get(event_info);
- if (!item_data || item_data->list_type < MC_TRACK
- || item_data->list_type > MC_FOLDER_TRACK) {
+ if (!item_data || item_data->list_type > MC_FOLDER_TRACK) {
return NULL;
}
if ((item_data->list_type == MC_TRACK)
item_size = item_size + mpFileInfo.st_size;
item = elm_genlist_item_next_get(item);
}
- return item_size;
-
endfunc;
+ return item_size;
}
static unsigned int _get_media_list_count(void *data)
}
if (count > 0) {
count = count - 1;
+ endfunc;
return count;
} else {
+ endfunc;
return -1;
}
-
- endfunc;
}
unsigned int _get_select_count(void *data) //(Evas_Object *genlist)
}
if (!g_strcmp0(media->i.minfo->year, "Unknown")) {
char *default_year = g_strdup("2014");
- strncpy(media->i.minfo->year, default_year, strlen(default_year));
+ strncpy(media->i.minfo->year, default_year, (strlen(default_year) + 1));
IF_G_FREE(default_year);
}
if (media->i.minfo->year) {
#define MP_LYRIC_PARSE_END_INDEX "]"
#define MP_LYRIC_PARSE_START_CHAR '['
#define MP_LYRIC_PARSE_END_CHAR ']'
+#define SYNC_MAX_LEN 9999
static long _mp_lyric_mgr_str2time(const char *text);
static void _mp_lyric_mgr_data_free(mp_lyric_mgr_t ** data);
if (sync_len || unsync_len) {
DEBUG_TRACE("sync_len=%d", sync_len);
- if (sync_len > 0) {
+ if (sync_len > 0 && sync_len <= SYNC_MAX_LEN) {
int ret = 0;
int idx = 0;
unsigned long time_info = 0;
startfunc;
MP_CHECK_VAL(playlist_mgr, 0);
- return playlist_mgr->repeat_state;
endfunc;
+ return playlist_mgr->repeat_state;
}
int mp_playlist_mgr_set_item_change_callback(mp_plst_mgr * playlist_mgr,
/* uri */
if (fgets(line, MAX_NAM_LEN, appender->fp)) {
line[MAX_NAM_LEN] = 0;
- line[strlen(line) - 1] = 0;
+ int length = strlen(line);
+ if (length > 1)
+ line[length - 1] = 0;
+ else
+ line[0] = 0;
} else {
break;
}
/* uri */
if (fgets(line, MAX_NAM_LEN, fp)) {
line[MAX_NAM_LEN] = 0;
- line[strlen(line) - 1] = 0;
+ int length = strlen(line);
+ if (length > 1)
+ line[length - 1] = 0;
+ else
+ line[0] = 0;
} else {
break;
}
}
if (fgets(line, MAX_NAM_LEN, fp)) { /* pid */
line[MAX_NAM_LEN] = 0;
- line[strlen(line) - 1] = 0;
+ int length = strlen(line);
+ if (length > 1)
+ line[length - 1] = 0;
+ else
+ line[0] = 0;
pid = atoi(line);
}
fclose(fp);
}
if (fgets(line, MAX_NAM_LEN, fp)) { /* uri */
line[MAX_NAM_LEN] = 0;
- line[strlen(line) - 1] = 0;
+ int length = strlen(line);
+ if (length > 1)
+ line[length - 1] = 0;
+ else
+ line[0] = 0;
*path = g_strdup(line);
}
fclose(fp);
#ifdef MP_FEATURE_EXIT_ON_BACK
#define MP_EXIT_ON_BACK "ExitOnBack"
#endif
+#define COUNT_MAX_VALUE 9999
struct appdata *g_ad;
static bool g_normal_launched = false;
}
mp_playlist_mgr_clear(ad->playlist_mgr);
- for (i = 0; i < count; i++, str = NULL) {
- token =
- strtok_r(str, MP_EXTRA_KEY_PLAY_FILE_DELIM, &save_ptr);
- if (token == NULL) {
- break;
- }
- if (count == 1) {
- mp_playlist_mgr_item_append(ad->playlist_mgr, token,
- NULL, title, NULL,
- MP_TRACK_URI);
- } else {
- mp_playlist_mgr_item_append(ad->playlist_mgr, token,
- NULL, NULL, NULL,
- MP_TRACK_URI);
+ if (count > 0 && count <= COUNT_MAX_VALUE) {
+ for (i = 0; i < count; i++, str = NULL) {
+ token =
+ strtok_r(str, MP_EXTRA_KEY_PLAY_FILE_DELIM, &save_ptr);
+ if (token == NULL) {
+ break;
+ }
+ if (count == 1) {
+ mp_playlist_mgr_item_append(ad->playlist_mgr, token,
+ NULL, title, NULL,
+ MP_TRACK_URI);
+ } else {
+ mp_playlist_mgr_item_append(ad->playlist_mgr, token,
+ NULL, NULL, NULL,
+ MP_TRACK_URI);
+ }
}
}
mp_playlist_mgr_set_current(ad->playlist_mgr,
return ret;
- IF_FREE(value);
+ //IF_FREE(value);
#endif
return 0;
}
list->track_lists = g_list_append(list->track_lists, svc_handle);
return real_count;
END:
- return 0;
endfunc;
+ return 0;
}
static void _free_track_lists(void *data)
item = mp_list_item_next_get(item);
}
- END:
- if (selected || sel_list) {
- *selected = sel_list;
- }
+ *selected = sel_list;
+ return;
+
+ END:
+ *selected = sel_list;
}
static char *_mp_artist_detail_list_bottom_counter_text_cb(void *thiz)
ad->checkedList = g_list_append(ad->checkedList, g_strdup(uri));
} else {
GList *list;
- for(list = ad->checkedList; list != NULL; list = list->next) {
+ for (list = ad->checkedList; list != NULL; list = list->next) {
if (!g_strcmp0(uri, list->data)) {
ad->checkedList = g_list_delete_link(ad->checkedList, list);
}
}
item = mp_list_item_next_get(item);
}
- END:
- if (selected || sel_list) {
- *selected = sel_list;
- }
+ *selected = sel_list;
+ return;
+
+ END:
+ *selected = sel_list;
}
static void _mp_list_all_item_data_get(void *thiz, GList ** selected)
(char *) malloc(sizeof(char) * (strlen(text_old) + 50));
MP_CHECK(text_new);
char *text = g_strdup("<color=");
- strncpy(text_new, text, strlen(text));
+ strncpy(text_new, text, (strlen(text) + 1));
IF_G_FREE(text);
- strncat(text_new, color, strlen(color));
+ strncat(text_new, color, (strlen(color) + 1));
text = g_strdup(">");
- strncat(text_new, text, strlen(text));
+ strncat(text_new, text, (strlen(text) + 1));
IF_G_FREE(text);
- strncat(text_new, text_old, strlen(text_old));
+ strncat(text_new, text_old, (strlen(text_old) + 1));
text = g_strdup("</color>");
- strncat(text_new, text, strlen(text));
+ strncat(text_new, text, (strlen(text) + 1));
IF_G_FREE(text);
edje_object_part_text_set(_EDJ(obj), "txt", text_new);
char *value = NULL;
key = strtok_r(str, "=", &sptr);
value = strtok_r(NULL, "=", &sptr);
- DEBUG_TRACE("key is: %s and value is: %s", key, value);
- if (!strcmp(key, " \n")) {
- ERROR_TRACE("Current File is removed. No contents.");
- line_count++;
+ if (key == NULL) {
+ DEBUG_TRACE("key is NULL");
continue;
}
- if (value != NULL) {
- value[strlen(value) - 1] = '\0';
- } else {
+ if (value == NULL) {
DEBUG_TRACE("value is NULL");
continue;
}
- if (key == NULL) {
+ DEBUG_TRACE("key is: %s and value is: %s", key, value);
+
+ if (!strcmp(key, " \n")) {
+ ERROR_TRACE("Current File is removed. No contents.");
+ line_count++;
continue;
}
+ value[strlen(value) - 1] = '\0';
+
if (!strcmp(key, " ")) {
ERROR_TRACE("Cannot determine key");
fclose(file);
wgtdata->file_path =
(char *) malloc((strlen(value) + 1) * sizeof(char));
if (wgtdata->file_path) {
- strncpy(wgtdata->file_path, value, strlen(value));
+ strncpy(wgtdata->file_path, value, (strlen(value) + 1));
wgtdata->file_path[strlen(value)] = '\0';
}
}
(char *) malloc((strlen(value) + 1) * sizeof(char));
if (image_path != NULL) {
- strncpy(image_path, value, strlen(value));
+ strncpy(image_path, value, (strlen(value) + 1));
image_path[strlen(value)] = '\0';
if (!strcmp(BROKEN_ALBUMART_IMAGE_PATH, image_path)) {
(char *) malloc((strlen(value) + 1) * sizeof(char));
if (wgtdata->file_path) {
- strncpy(wgtdata->file_path, value, strlen(value));
+ strncpy(wgtdata->file_path, value, (strlen(value) + 1));
wgtdata->file_path[strlen(value)] = '\0';
}
}
image_path =
(char *) malloc((strlen(value) + 1) * sizeof(char));
if (image_path) {
- strncpy(image_path, value, strlen(value));
+ strncpy(image_path, value, (strlen(value) + 1));
image_path[strlen(value)] = '\0';
if (!strcmp(BROKEN_ALBUMART_IMAGE_PATH, image_path)) {
telephony_handle_list_s tel_list;
telephony_error_e ret_sim;
unsigned int count_sim[2];
+ count_sim[0] = 0;
+ count_sim[1] = 0;
int tel_valid = telephony_init(&tel_list);
if (tel_valid != 0) {
return false;
}
- for (int i=0;i<tel_list.count;i++) {
+ for (int i = 0; i < tel_list.count; i++) {
ret_sim =
telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
&call_list_sim);
extra_data_values[i] = (char *) malloc(50);
}
- strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, strlen(MP_LB_EVENT_KEY));
+ strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, (strlen(MP_LB_EVENT_KEY) + 1));
extra_data_keys[0][strlen(MP_LB_EVENT_KEY)] = '\0';
if (!is_play) {
strncpy(extra_data_values[0], MP_LB_EVENT_PLAY_CLICKED,
- strlen(MP_LB_EVENT_PLAY_CLICKED));
+ (strlen(MP_LB_EVENT_PLAY_CLICKED) + 1));
extra_data_values[0][strlen(MP_LB_EVENT_PLAY_CLICKED)] = '\0';
} else {
strncpy(extra_data_values[0], MP_LB_EVENT_PAUSE_CLICKED,
- strlen(MP_LB_EVENT_PAUSE_CLICKED));
+ (strlen(MP_LB_EVENT_PAUSE_CLICKED) + 1));
extra_data_values[0][strlen(MP_LB_EVENT_PAUSE_CLICKED)] = '\0';
}
extra_data_values[i] = (char *) malloc(50);
}
- strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, strlen(MP_LB_EVENT_KEY));
+ strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, (strlen(MP_LB_EVENT_KEY) + 1));
extra_data_keys[0][strlen(MP_LB_EVENT_KEY)] = '\0';
strncpy(extra_data_values[0], MP_LB_EVENT_PREV_RELEASED,
- strlen(MP_LB_EVENT_PREV_RELEASED));
+ (strlen(MP_LB_EVENT_PREV_RELEASED) + 1));
extra_data_values[0][strlen(MP_LB_EVENT_PREV_RELEASED)] = '\0';
if (message_port_init(extra_data_values[0]) != MESSAGE_PORT_ERROR_NONE) {
extra_data_values[i] = (char *) malloc(50);
}
- strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, strlen(MP_LB_EVENT_KEY));
+ strncpy(extra_data_keys[0], MP_LB_EVENT_KEY, (strlen(MP_LB_EVENT_KEY) + 1));
extra_data_keys[0][strlen(MP_LB_EVENT_KEY)] = '\0';
strncpy(extra_data_values[0], MP_LB_EVENT_NEXT_RELEASED,
- strlen(MP_LB_EVENT_NEXT_RELEASED));
+ (strlen(MP_LB_EVENT_NEXT_RELEASED) + 1));
extra_data_values[0][strlen(MP_LB_EVENT_NEXT_RELEASED)] = '\0';
if (message_port_init(extra_data_values[0]) != MESSAGE_PORT_ERROR_NONE) {