Fix the crash issue on a chatroom search 41/62441/1
authorcskim <charles0.kim@samsung.com>
Wed, 16 Mar 2016 06:29:54 +0000 (15:29 +0900)
committercskim <charles0.kim@samsung.com>
Wed, 16 Mar 2016 06:29:54 +0000 (15:29 +0900)
remove compilation warnings.

Change-Id: Ic77984c1bc1faa49ba857910db2835e6cdba3fe0

21 files changed:
TelegramTizen/contacts_utils/contacts_common.c
TelegramTizen/contacts_utils/device_contacts_manager.c
TelegramTizen/db_manager/tg_db_manager.c
TelegramTizen/src/telegramtizen.c
TelegramTizen/src/tg_audio_player.c
TelegramTizen/src/tg_chat_info_view.c
TelegramTizen/src/tg_country_selection_view.c
TelegramTizen/src/tg_db_wrapper.c
TelegramTizen/src/tg_messaging_view.c
TelegramTizen/src/tg_select_buddy_from_list.c
TelegramTizen/tg_utils/tg_common.c
tg-engine-service/contacts_utils/device_contacts_manager.c
tg-engine-service/db_manager/tg_db_manager.c
tg-engine-service/db_manager/tg_db_manager.h
tg-engine-service/mtprotocol/queries.c
tg-engine-service/mtprotocol/tgl.h
tg-engine-service/src/tg-engine-service.c
tg-engine-service/src/tg_db_wrapper.c
tg-engine-service/tg_engine/tg_engine.c
tg-engine-service/tg_engine_utils/tg_common.c
tg-engine-service/tg_engine_utils/tg_common.h

index fa329c5..04127c8 100644 (file)
@@ -142,9 +142,8 @@ struct tm sc_common_int_to_date(int date_value)
 char *sc_common_date_to_str(struct tm *date)
 {
        char *ret_str = malloc(DATE_STRING_LENGTH);
-       if(ret_str)
-       {
-               sprintf(ret_str, "%d/%d/%d", date->tm_year + 1900, date->tm_mon + 1, date->tm_mday);
+       if (ret_str) {
+               snprintf(ret_str, DATE_STRING_LENGTH, "%d/%d/%d", date->tm_year + 1900, date->tm_mon + 1, date->tm_mday);
        }
        return ret_str;
 }
index ebd8211..6b18d93 100644 (file)
@@ -81,6 +81,7 @@ Eina_List *get_contact_list_from_device_db()
                                && sc_db_utils_is_success(contacts_record_get_int(record, _contacts_person.id, &id)))
                {
                        contact_data_s *contact_data = (contact_data_s*)malloc(sizeof(*contact_data));
+                       memset(contact_data, 0, sizeof(contact_data_s));
 
                        contact_data->display_name = NULL;
                        contact_data->first_name = NULL;
index a492e03..4efda01 100644 (file)
@@ -295,12 +295,10 @@ Eina_Bool get_values_from_table(const char* table_name, Eina_List *column_names,
        eina_strbuf_append(var_query, "SELECT ");
 
        if(!column_names) {
-               var_query = realloc(var_query, strlen(var_query) + 3);
                eina_strbuf_append(var_query, "* ");
        } else {
 
                int col_count = eina_list_count(column_names);
-               char* col_name = NULL;
                for(int col = 0; col < col_count ; col++) {
                        eina_strbuf_append(var_query, eina_list_nth(column_names, col));
                        if (col < col_count - 1)
index d3af8b1..53b3093 100755 (executable)
@@ -85,7 +85,6 @@ void load_list_of_countries(appdata_s *ad)
        if (!ad)
                return;
 
-       int size_of_listed_countries = 0;
        const char *file_name = ui_utils_get_resource(TG_LIST_OF_COUNTIRES);
        if (!file_name)
                return;
@@ -196,6 +195,7 @@ void load_registered_user_data(appdata_s *ad)
        }
 
        ad->current_user_data = (user_data_s*)malloc(sizeof(user_data_s));
+       memset(ad->current_user_data, 0, sizeof(user_data_s));
 
 
        Eina_List *row_vals = NULL;
@@ -312,6 +312,7 @@ void load_peer_data(appdata_s *ad)
        Eina_List *ts_msg = NULL;
        EINA_LIST_FREE(peer_details, ts_msg) {
                tg_peer_info_s* peer_info = (tg_peer_info_s*)malloc(sizeof(*peer_info));
+               memset(peer_info, 0, sizeof(tg_peer_info_s));
 
                int *temp_peer_id = (int *)eina_list_nth(ts_msg, 0);
                if (temp_peer_id) {
@@ -381,9 +382,8 @@ void load_peer_data(appdata_s *ad)
                eina_list_free(ts_msg);
 
                peer_with_pic_s *item = (peer_with_pic_s*) malloc(sizeof(*item));
+               memset(item, 0, sizeof(peer_with_pic_s));
                item->use_data = peer_info;
-               item->contact_icon = NULL;
-
                ad->peer_list = eina_list_append(ad->peer_list, item);
 
        }
@@ -492,13 +492,13 @@ void load_main_list_data(appdata_s *ad)
                        }
 
                        tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+                       memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                        main_list_item->peer_id = peer_info->peer_id;
                        main_list_item->peer_type = peer_info->peer_type;
 
                        set_peer_names(peer_info, main_list_item);
 
                        main_list_item->last_seen_time = msg->date;
-                       main_list_item->profile_pic = NULL;
                        main_list_item->last_msg_id = msg->msg_id;
                        main_list_item->last_message = strdup(item->last_message);
                        main_list_item->last_msg_type = msg->media_type;
@@ -509,15 +509,7 @@ void load_main_list_data(appdata_s *ad)
 
                        if (peer_info->photo_path)
                                main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-                       else
-                               main_list_item->profile_pic_path = NULL;
-
-                       main_list_item->user_name_lbl = NULL;
-                       main_list_item->status_lbl = NULL;
-                       main_list_item->date_lbl = NULL;
-                       main_list_item->msg_status_lbl = NULL;
-                       main_list_item->main_item_layout = NULL;
-                       main_list_item->highlight_text = NULL;
+
                        ad->main_list = eina_list_append(ad->main_list, main_list_item);
 
                        // delete message object
@@ -536,13 +528,13 @@ void load_main_list_data(appdata_s *ad)
                        item->last_message = strdup(" ");
                        if (peer_info->peer_type == TGL_PEER_CHAT) {
                                tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+                               memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                                main_list_item->peer_id = peer_info->peer_id;
                                main_list_item->peer_type = peer_info->peer_type;
 
                                set_peer_names(peer_info, main_list_item);
 
                                main_list_item->last_seen_time = peer_info->last_seen_time;
-                               main_list_item->profile_pic = NULL;
                                main_list_item->last_message = strdup(item->last_message);
                                main_list_item->last_msg_type = -1;
                                main_list_item->last_msg_service = 0;
@@ -551,17 +543,8 @@ void load_main_list_data(appdata_s *ad)
                                main_list_item->last_msg_status = -1;
                                main_list_item->number_of_unread_msgs = 0;
 
-                               if (peer_info->photo_path) {
+                               if (peer_info->photo_path)
                                        main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-                               } else {
-                                       main_list_item->profile_pic_path = NULL;
-                               }
-                               main_list_item->user_name_lbl = NULL;
-                               main_list_item->status_lbl = NULL;
-                               main_list_item->date_lbl = NULL;
-                               main_list_item->msg_status_lbl = NULL;
-                               main_list_item->main_item_layout = NULL;
-                               main_list_item->highlight_text = NULL;
                                ad->main_list = eina_list_append(ad->main_list, main_list_item);
                        }
                }
@@ -641,9 +624,9 @@ void load_unknown_buddy_list_data(appdata_s *ad)
                }
 
                user_data_s *user_data = (user_data_s*)malloc(sizeof(*user_data));
+               memset(user_data, 0, sizeof(user_data_s));
                user_data->is_selected = EINA_FALSE;
 
-
                if (temp_user_id) {
                        user_data->user_id.id = *temp_user_id;
                        user_data->user_id.type = TGL_PEER_USER;
@@ -716,8 +699,8 @@ void load_unknown_buddy_list_data(appdata_s *ad)
                user_data->highlight_name = NULL;
 
                user_data_with_pic_s *item = (user_data_with_pic_s *)malloc(sizeof(*item));
+               memset(item, 0, sizeof(user_data_with_pic_s));
                item->use_data = user_data;
-               item->contact_icon = NULL;
                ad->unknown_buddy_list = eina_list_append(ad->unknown_buddy_list, item);
 
                eina_list_free(row_vals);
@@ -798,6 +781,7 @@ void load_buddy_list_data(appdata_s *ad)
                }
 
                user_data_s *user_data = (user_data_s *)malloc(sizeof(*user_data));
+               memset(user_data, 0, sizeof(user_data_s));
                user_data->is_selected = EINA_FALSE;
 
 
@@ -873,6 +857,7 @@ void load_buddy_list_data(appdata_s *ad)
                user_data->highlight_name = NULL;
 
                user_data_with_pic_s *item = (user_data_with_pic_s *) malloc(sizeof(*item));
+               memset(item, 0, sizeof(user_data_with_pic_s));
                item->use_data = user_data;
                item->contact_icon = NULL;
                ad->buddy_list = eina_list_append(ad->buddy_list, item);
@@ -2721,13 +2706,13 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad,  peer_with_pic_s *item)
                }
 
                main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+               memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                main_list_item->peer_id = peer_info->peer_id;
                main_list_item->peer_type = peer_info->peer_type;
 
                set_peer_names(peer_info, main_list_item);
 
                main_list_item->last_seen_time = msg->date;
-               main_list_item->profile_pic = NULL;
                main_list_item->last_msg_id = msg->msg_id;
                main_list_item->last_message = strdup(item->last_message);
                main_list_item->last_msg_type = msg->media_type;
@@ -2736,16 +2721,8 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad,  peer_with_pic_s *item)
                main_list_item->last_msg_service = msg->service;
                main_list_item->number_of_unread_msgs = get_unread_message_count(tablename);
 
-               if (peer_info->photo_path) {
+               if (peer_info->photo_path)
                        main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-               } else {
-                       main_list_item->profile_pic_path = NULL;
-               }
-               main_list_item->user_name_lbl = NULL;
-               main_list_item->status_lbl = NULL;
-               main_list_item->date_lbl = NULL;
-               main_list_item->msg_status_lbl = NULL;
-               main_list_item->main_item_layout = NULL;
 
                // delete message object
                if (msg->message) {
@@ -2765,13 +2742,13 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad,  peer_with_pic_s *item)
                item->last_message = strdup(" ");
                if (peer_info->peer_type == TGL_PEER_CHAT) {
                        main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+                       memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                        main_list_item->peer_id = peer_info->peer_id;
                        main_list_item->peer_type = peer_info->peer_type;
 
                        set_peer_names(peer_info, main_list_item);
 
                        main_list_item->last_seen_time = peer_info->last_seen_time;
-                       main_list_item->profile_pic = NULL;
                        main_list_item->last_message = strdup(item->last_message);
                        main_list_item->last_msg_type = -1;
                        main_list_item->last_msg_service = 0;
@@ -2780,16 +2757,8 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad,  peer_with_pic_s *item)
                        main_list_item->last_msg_status = -1;
                        main_list_item->number_of_unread_msgs = 0;
 
-                       if (peer_info->photo_path && strlen(peer_info->photo_path) > 0) {
+                       if (peer_info->photo_path && strlen(peer_info->photo_path) > 0)
                                main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-                       } else {
-                               main_list_item->profile_pic_path = NULL;
-                       }
-                       main_list_item->user_name_lbl = NULL;
-                       main_list_item->status_lbl = NULL;
-                       main_list_item->date_lbl = NULL;
-                       main_list_item->msg_status_lbl = NULL;
-                       main_list_item->main_item_layout = NULL;
 
                }
        }
@@ -2945,13 +2914,13 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info)
                                                                }
 
                                                                tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+                                                               memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                                                                main_list_item->peer_id = peer_info->peer_id;
                                                                main_list_item->peer_type = peer_info->peer_type;
 
                                                                set_peer_names(peer_info, main_list_item);
 
                                                                main_list_item->last_seen_time = msg->date;
-                                                               main_list_item->profile_pic = NULL;
                                                                main_list_item->last_msg_id = msg->msg_id;
                                                                main_list_item->last_message = strdup(item->last_message);
                                                                main_list_item->last_msg_type = msg->media_type;
@@ -2960,16 +2929,9 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info)
                                                                main_list_item->last_msg_service = msg->service;
                                                                main_list_item->number_of_unread_msgs = get_unread_message_count(tablename);
 
-                                                               if (peer_info->photo_path) {
+                                                               if (peer_info->photo_path)
                                                                        main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-                                                               } else {
-                                                                       main_list_item->profile_pic_path = NULL;
-                                                               }
-                                                               main_list_item->user_name_lbl = NULL;
-                                                               main_list_item->status_lbl = NULL;
-                                                               main_list_item->date_lbl = NULL;
-                                                               main_list_item->msg_status_lbl = NULL;
-                                                               main_list_item->main_item_layout = NULL;
+
                                                                ad->main_list = eina_list_prepend(ad->main_list, main_list_item);
 
                                                                // delete message object
@@ -2990,13 +2952,13 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info)
                                                                item->last_message = strdup(" ");
                                                                if (peer_info->peer_type == TGL_PEER_CHAT) {
                                                                        tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s));
+                                                                       memset(main_list_item, 0, sizeof(tg_main_list_item_s));
                                                                        main_list_item->peer_id = peer_info->peer_id;
                                                                        main_list_item->peer_type = peer_info->peer_type;
 
                                                                        set_peer_names(peer_info, main_list_item);
 
                                                                        main_list_item->last_seen_time = peer_info->last_seen_time;
-                                                                       main_list_item->profile_pic = NULL;
                                                                        main_list_item->last_message = strdup(item->last_message);
                                                                        main_list_item->last_msg_type = -1;
                                                                        main_list_item->last_msg_service = 0;
@@ -3005,17 +2967,9 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info)
                                                                        main_list_item->last_msg_status = -1;
                                                                        main_list_item->number_of_unread_msgs = 0;
 
-                                                                       if (peer_info->photo_path) {
+                                                                       if (peer_info->photo_path)
                                                                                main_list_item->profile_pic_path = strdup(peer_info->photo_path);
-                                                                       } else {
-                                                                               main_list_item->profile_pic_path = NULL;
-                                                                       }
-                                                                       main_list_item->user_name_lbl = NULL;
-                                                                       main_list_item->status_lbl = NULL;
-                                                                       main_list_item->date_lbl = NULL;
-                                                                       main_list_item->msg_status_lbl = NULL;
-                                                                       main_list_item->main_item_layout = NULL;
-                                                                       main_list_item->highlight_text = NULL;
+
                                                                        ad->main_list = eina_list_prepend(ad->main_list, main_list_item);
                                                                }
                                                        }
@@ -3322,9 +3276,8 @@ char *build_a_path(const char *path, const char *filename)
 
        len = strlen(path) + strlen(filename) + 2;
        ret = malloc(len);
-       if (!ret) {
+       if (!ret)
                return NULL;
-       }
 
        snprintf(ret, len, "%s/%s", path, filename);
        return ret;
@@ -3357,20 +3310,15 @@ int remove_directory(const char *path)
                        len = path_len + strlen(p->d_name) + 2;
                        buf = malloc(len);
 
-                       if (buf)
-                       {
+                       if (buf) {
                                struct stat statbuf;
 
                                snprintf(buf, len, "%s/%s", path, p->d_name);
 
-                               if (!stat(buf, &statbuf))
-                               {
-                                       if (S_ISDIR(statbuf.st_mode))
-                                       {
+                               if (!stat(buf, &statbuf)) {
+                                       if (S_ISDIR(statbuf.st_mode)) {
                                                r2 = remove_directory(buf);
-                                       }
-                                       else
-                                       {
+                                       } else {
                                                r2 = unlink(buf);
                                        }
                                }
index 0065508..a069327 100644 (file)
@@ -64,6 +64,7 @@ tg_player_handler* init_audio_player(const char *audio_file, tg_player_state_cha
        tg_player_handler *player = NULL;
        if (access(audio_file, F_OK) != -1) {
                player = (tg_player_handler*)malloc(sizeof(tg_player_handler));
+               memset(player, 0, sizeof(tg_player_handler));
                if (player) {
                        player->timer = NULL;
                        player->current_pos = 0;
index 67f6b98..f3b64a7 100644 (file)
@@ -561,7 +561,7 @@ void on_chat_info_longpress_clicked_cb(void *data, Evas_Object *obj, void *event
        } else if (user_data->peer_type == TGL_PEER_CHAT) {
                if (id == 0) {
                        if (ad->selected_buddy_item) {
-                               user_data_s *sel_user = ad->selected_buddy_item;
+                               /* user_data_s *sel_user = ad->selected_buddy_item; */
                                show_loading_popup(ad);
                                send_remove_buddy_from_group_chat_request(ad, ad->service_client, ad->selected_buddy_item->user_id.id, ad->peer_in_cahtting_data->use_data->peer_id);
                        }
@@ -928,7 +928,7 @@ void launch_chat_info_screen(appdata_s* ad, int chat_id)
        evas_object_smart_callback_add(msg_btn, "clicked", on_chat_camera_button_clicked, msg_btn);
        evas_object_data_set(msg_btn, "app_data", ad);
 
-       Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Chat Info", NULL, NULL, scroller, NULL);
+       elm_naviframe_item_push(ad->nf, "Chat Info", NULL, NULL, scroller, NULL);
        eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, on_chat_info_menu_button_clicked, ad);
 
 }
index d24543f..111761b 100644 (file)
@@ -157,8 +157,6 @@ static void on_country_item_clicked(void *data, Evas_Object *obj, void *event_in
 {
        Eina_List *country_name_list;
        Eina_List *country_code_list;
-       Evas_Object *popup;
-       Evas_Object *btn;
        appdata_s* ad;
 
        elm_genlist_item_selected_set(event_info, EINA_FALSE);
index 39a6f44..5982345 100755 (executable)
@@ -20,7 +20,7 @@
 #include <mime_type.h>
 #include <utils_i18n.h>
 
-static const char* g_empty_char = "";
+static char* g_empty_char = "";
 static const char* g_zero_char = "0.000";
 static const int g_base_int = -1;
 static const int g_zero_int = 0;
@@ -216,6 +216,7 @@ peer_with_pic_s* get_peer_info(int peer_id)
        EINA_LIST_FREE(peer_details, ts_msg) {
                if (pos == 0) {
                        tg_peer_info_s* peer_info = (tg_peer_info_s*)malloc(sizeof(tg_peer_info_s));
+                       memset(peer_info, 0, sizeof(tg_peer_info_s));
 
                        int *temp_peer_id = (int *)eina_list_nth(ts_msg, 0);
                        if (temp_peer_id) {
@@ -297,6 +298,7 @@ peer_with_pic_s* get_peer_info(int peer_id)
                        eina_list_free(ts_msg);
 
                        item = (peer_with_pic_s*) malloc(sizeof(peer_with_pic_s));
+                       memset(item, 0, sizeof(peer_with_pic_s));
                        item->use_data = peer_info;
                        item->contact_icon = NULL;
                } else {
@@ -413,6 +415,7 @@ tg_chat_info_s* get_chat_info(int chat_id)
                Eina_List *ts_msg = eina_list_nth(chat_details, 0);
 
                chat_info = (tg_chat_info_s*)malloc(sizeof(tg_chat_info_s));
+               memset(chat_info, 0, sizeof(tg_chat_info_s));
 
                int *temp_chat_id = (int *)eina_list_nth(ts_msg, 0);
                if (temp_chat_id) {
@@ -1106,6 +1109,7 @@ tg_message_s *get_latest_message_from_message_table(char *table_name, Eina_Bool
        if (message_details && eina_list_count(message_details) > 0) {
                Eina_List *ts_msg = eina_list_nth(message_details, 0);
                message = (tg_message_s*)malloc(sizeof(tg_message_s));
+               memset(message, 0, sizeof(tg_message_s));
 
                int *temp_msg_id = (int *)eina_list_nth(ts_msg, 0);
                if (temp_msg_id)
@@ -1401,6 +1405,7 @@ tg_message_s *get_message_from_message_table(long long msg_id, char *table_name)
        if (message_details && eina_list_count(message_details) > 0) {
                Eina_List *ts_msg = eina_list_nth(message_details, 0);
                message = (tg_message_s*)malloc(sizeof(tg_message_s));
+               memset(message, 0, sizeof(tg_message_s));
                int *temp_msg_id = (int *)eina_list_nth(ts_msg, 0);
                if (temp_msg_id) {
                        message->msg_id  = *temp_msg_id;
@@ -1557,6 +1562,7 @@ Eina_List *get_messages_from_message_table_order_by(char *table_name, const char
 
        EINA_LIST_FREE(message_details, ts_msg) {
                message = (tg_message_s*)malloc(sizeof(tg_message_s));
+               memset(message, 0, sizeof(tg_message_s));
                message_list = eina_list_append(message_list, message);
 
                int *temp_msg_id = (int *)eina_list_nth(ts_msg, 0);
@@ -2185,7 +2191,7 @@ void insert_media_info_to_db(tg_message_s *M, char *file_path, int width, int he
        int doc_dc = 0;
        col_values = eina_list_append(col_values, &doc_dc);
 
-       const char *doc_thumb = NULL;
+       char *doc_thumb = NULL;
        get_thumbnail_from_video_url(file_path, &doc_thumb);
 
        if (!doc_thumb) {
@@ -2621,6 +2627,7 @@ Eina_List *load_buddy_data_by_name(int current_user, char *name)
                }
 
                user_data_s* user_data = (user_data_s*)malloc(sizeof(user_data_s));
+               memset(user_data, 0, sizeof(user_data_s));
                user_data->is_selected = EINA_FALSE;
 
                if (temp_user_id) {
@@ -2745,6 +2752,7 @@ Eina_List *load_buddy_data_by_name(int current_user, char *name)
                user_data->highlight_name = NULL;
 
                user_data_with_pic_s *item = (user_data_with_pic_s*) malloc(sizeof(user_data_with_pic_s));
+               memset(item, 0, sizeof(user_data_with_pic_s));
                item->use_data = user_data;
                item->contact_icon = NULL;
                buddy_list = eina_list_append(buddy_list, item);
@@ -2762,6 +2770,7 @@ Eina_List *load_peer_data_by_name(char *name)
        Eina_List *ts_msg = NULL;
        EINA_LIST_FREE(peer_details, ts_msg) {
                tg_peer_info_s* peer_info = (tg_peer_info_s*)malloc(sizeof(tg_peer_info_s));
+               memset(peer_info, 0, sizeof(tg_peer_info_s));
                int *temp_peer_id = (int *)eina_list_nth(ts_msg, 0);
                if (temp_peer_id) {
                        peer_info->peer_id  = *temp_peer_id;
@@ -2842,6 +2851,7 @@ Eina_List *load_peer_data_by_name(char *name)
 
                eina_list_free(ts_msg);
                peer_with_pic_s *item = (peer_with_pic_s*) malloc(sizeof(peer_with_pic_s));
+               memset(item, 0, sizeof(peer_with_pic_s));
                item->use_data = peer_info;
                item->contact_icon = NULL;
                peer_list = eina_list_append(peer_list, item);
@@ -2915,6 +2925,7 @@ tgl_media_s *get_media_details_from_db(long long media_id)
        }
 
        tgl_media_s* media_info = (tgl_media_s*)malloc(sizeof(tgl_media_s));
+       memset(media_info, 0, sizeof(tgl_media_s));
 
        Eina_List *row_vals = eina_list_nth(img_details, 0);
 
index ea8ffa2..7b2a451 100644 (file)
@@ -173,7 +173,7 @@ static void scroller_push_item(Evas_Object *scroller, Evas_Object *item, int pre
 /************************ Menu Handler ********************/
 void clear_history_in_gui(appdata_s *ad, tg_peer_info_s *user_data, int peer_type, int peer_id)
 {
-       if(!ad || !user_data)
+       if (!ad || !user_data)
                return;
 
        {
@@ -361,7 +361,7 @@ char* on_messaging_menu_text_get_cb(void *data, Evas_Object *obj, const char *pa
        peer_with_pic_s  *sel_item = ad->peer_in_cahtting_data;
        tg_peer_info_s *user_data = sel_item->use_data;
 
-       if(user_data->peer_type != TGL_PEER_USER)
+       if (user_data->peer_type != TGL_PEER_USER)
                return NULL;
 
        switch(id)
@@ -416,6 +416,9 @@ void on_messaging_menu_button_clicked(void *data, Evas_Object *obj, void *event_
 
        itc.item_style = "default";
        peer_with_pic_s  *sel_item = ad->peer_in_cahtting_data;
+       if (!sel_item || !sel_item->use_data)
+               return;
+
        if (sel_item->use_data->peer_type == TGL_PEER_USER) {
                itc.func.text_get = on_messaging_menu_text_get_cb;
        } else if (sel_item->use_data->peer_type == TGL_PEER_CHAT) {
@@ -434,7 +437,7 @@ void on_messaging_menu_button_clicked(void *data, Evas_Object *obj, void *event_
                }
        } else {
                int strart_number_of_menus = 0;
-               if(get_buddy_delete_status(sel_item->use_data->peer_id))
+               if (get_buddy_delete_status(sel_item->use_data->peer_id))
                        strart_number_of_menus = 1;
                for (i = strart_number_of_menus; i < 3; i++) {
                        elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_messaging_menu_option_selected_cb, ad);
@@ -812,7 +815,11 @@ static void on_message_play_pause_clicked(void *data, Evas_Object *obj, void *ev
        appdata_s * ad = evas_object_data_get(data, "app_data");
        char *audio_file = evas_object_data_get(data, "audio_file_path");
        char *media_id = evas_object_data_get(data, "media_id");
-       if (!audio_file  || strlen(audio_file) <= 0 || (audio_file && strstr(audio_file, "_null_")) != NULL) {
+
+       if (!ad)
+               return;
+
+       if (!audio_file  || strlen(audio_file) <= 0 || !media_id) {
                //there is no file. download it.
                Evas_Object *progressbar = evas_object_data_get(data, "progress_control");
                Eina_Bool is_download_in_progress = (Eina_Bool)evas_object_data_get(progressbar, "is_download_in_progress");
@@ -1306,7 +1313,7 @@ static void __resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                        LOGE("Fail to show the bottom of scroller");
                }
        }
-       if(is_end_edge_top)
+       if (is_end_edge_top)
                scroller_show_previous_region(chat_scroller);
 }
 
@@ -2252,11 +2259,11 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id)
                Eina_List *names_of_buddies = NULL;
                names_of_buddies = evas_object_data_get(ad->nf, "names_of_buddies");
 
-               if(names_of_buddies != NULL){
+               if (names_of_buddies != NULL){
                        buddies_info *buddy = NULL;
                        EINA_LIST_FREE(names_of_buddies, buddy) {
                                if (buddy) {
-                                       if(buddy->name) {
+                                       if (buddy->name) {
                                                free(buddy->name);
                                        }
                                }
@@ -2285,6 +2292,7 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id)
                                char *buddy_name =  replace(buddy_full_name, '_', " ");
                                if (buddy_name) {
                                        buddies_info *buddy_info = (buddies_info*)malloc(sizeof(buddies_info));
+                                       memset(buddy_info, 0, sizeof(buddies_info));
                                        buddy_info->name = buddy_name;
                                        buddy_info->id = buddy_id;
                                        names_of_buddies = eina_list_append(names_of_buddies, (void*)(buddy_info));
@@ -2824,7 +2832,7 @@ static Eina_Bool on_timer_expired(void *data)
 Eina_Bool load_chat_history(Evas_Object *chat_scroller)
 {
        int offset_num = (int)evas_object_data_get(chat_scroller,"offset_num");
-       if(offset_num < -TG_DBMGR_LIMITED) return EINA_FALSE;
+       if (offset_num < -TG_DBMGR_LIMITED) return EINA_FALSE;
        appdata_s* ad = evas_object_data_get(chat_scroller, "app_data");
        int user_id = (int)evas_object_data_get(chat_scroller, "user_id");
 
@@ -2832,7 +2840,7 @@ Eina_Bool load_chat_history(Evas_Object *chat_scroller)
        int buddy_id = sel_item->use_data->peer_id;
        char* tablename = get_table_name_from_number(buddy_id);
        Eina_List *vals = NULL;
-       if(offset_num >= 0)
+       if (offset_num >= 0)
                vals = get_messages_from_message_table_order_by(tablename, MESSAGE_INFO_TABLE_DATE, EINA_TRUE, TG_DBMGR_LIMITED, offset_num);
        else
                vals = get_messages_from_message_table_order_by(tablename, MESSAGE_INFO_TABLE_DATE, EINA_TRUE, TG_DBMGR_LIMITED + offset_num, 0);
@@ -3467,11 +3475,11 @@ static void on_expand_button_clicked(void *data, Evas_Object *obj, void *event_i
                        buddies_info *buddy_info;
                        for(int i = 0 ; i < buddies_counts ; i++){
                                buddy_info = (buddies_info*)eina_list_nth(names_of_buddies,i);
-                               if(buddy_info == NULL) continue;
+                               if (buddy_info == NULL) continue;
                                int len = strlen(buddy_info->name);
                                char *name_str = (char *)malloc(len + 256);
-                               if(name_str){
-                                       sprintf(name_str, "<font=Tizen:style=Bold color=#FFFFFF align=center><font_size=40>%s</font_size></font>", buddy_info->name);
+                               if (name_str){
+                                       snprintf(name_str, len + 256, "<font=Tizen:style=Bold color=#FFFFFF align=center><font_size=40>%s</font_size></font>", buddy_info->name);
                                        Elm_Object_Item *button_item = elm_multibuttonentry_item_append(grp_names_lbl, name_str, click_user_name_cb, ad);
                                        elm_object_item_data_set(button_item, (void*)(buddy_info->id));
                                        free(name_str);
@@ -3566,8 +3574,9 @@ int get_start_offset_num(char* table_name){
        int unknown = 0;
        sprintf(unknown_str, "%d", unknown);
 
-       char* where_clause = (char *)malloc(strlen(MESSAGE_INFO_TABLE_MARKED_FOR_DELETE) + strlen(" = ") + strlen(unknown_str) + 1);
-       sprintf(where_clause, "%s = %s", MESSAGE_INFO_TABLE_MARKED_FOR_DELETE, unknown_str);
+       int len_where = strlen(MESSAGE_INFO_TABLE_MARKED_FOR_DELETE) + strlen(" = ") + strlen(unknown_str) + 1;
+       char* where_clause = (char *)malloc(len_where );
+       snprintf(where_clause, len_where , "%s = %s", MESSAGE_INFO_TABLE_MARKED_FOR_DELETE, unknown_str);
        int row_counts = get_number_of_rows(table_name,where_clause);
        return (row_counts-TG_DBMGR_LIMITED);
 }
index 9ed0616..67e1423 100644 (file)
@@ -207,7 +207,6 @@ static void on_buddy_item_selected(void *data, Evas_Object *obj, void *event_inf
        }
 
        int user_list_size = chat_info->user_list_size;
-       int online_members = 0;
 
        Eina_Bool is_already_present = EINA_FALSE;
        for (int i = 0; i < user_list_size; i++) {
index 2386259..23b861c 100644 (file)
@@ -175,12 +175,6 @@ int numbers_only(const char *s)
        return 1;
 }
 
-static bool mp_util_svc_iterate_for_get_video_item_cb(media_info_h item, void *user_data)
-{
-       return TRUE;
-}
-
-
 
 static bool __thumbnail_cb(media_info_h item, void *user_data)
 {
@@ -412,7 +406,7 @@ void free_user_data(user_data_s *user_data)
 }
 
 
-void tg_notification_create(appdata_s *app, char * icon_path, const char *title, char *content, char *sound_path, char *app_id)
+void tg_notification_create(appdata_s *app, const char * icon_path, const char *title, char *content, char *sound_path, char *app_id)
 {
        if (app && app->s_notififcation)
                notification_delete_all(NOTIFICATION_TYPE_NOTI);
index b3ef5b0..521f848 100644 (file)
@@ -64,6 +64,7 @@ Eina_List* get_contact_list_from_device_db()
                        if (sc_db_utils_is_success(contacts_record_get_str_p(record, _contacts_person.display_name, &name))
                                        && sc_db_utils_is_success(contacts_record_get_int(record, _contacts_person.id, &id))) {
                                contact_data_s* contact_data = (contact_data_s*)malloc(sizeof(contact_data_s));
+                               memset(contact_data, 0, sizeof(contact_data_s));
                                contact_data->display_name = NULL;
                                contact_data->first_name = NULL;
                                contact_data->last_name = NULL;
index 84f2f35..f0e6e75 100644 (file)
@@ -127,6 +127,7 @@ Eina_Bool create_table(const char *table_name, Eina_List *column_names, Eina_Lis
                sqlite3_free(err_msg);
                return EINA_FALSE;
        }
+       return EINA_TRUE;
 }
 
 Eina_Bool insert_table(const char *table_name, Eina_List *column_names, Eina_List *column_types, Eina_List *column_values)
@@ -284,12 +285,10 @@ Eina_Bool get_values_from_table(const char *table_name, Eina_List *column_names,
                eina_strbuf_append(var_query, "SELECT ");
 
                if(!column_names) {
-                       var_query = realloc(var_query, strlen(var_query) + 3);
                        eina_strbuf_append(var_query, "* ");
                } else {
 
                        int col_count = eina_list_count(column_names);
-                       char* col_name = NULL;
                        for(int col = 0; col < col_count ; col++) {
                                eina_strbuf_append(var_query, eina_list_nth(column_names, col));
                                if (col < col_count - 1)
@@ -653,7 +652,7 @@ Eina_Bool drop_table(char *tablename)
        return EINA_TRUE;
 }
 
-int get_number_of_rows(char *table_name, char *where_clause)
+int get_number_of_rows(const char *table_name, char *where_clause)
 {
        int no_of_rows = 0;
        if (!table_name || !where_clause)
index a959182..6634deb 100644 (file)
@@ -34,5 +34,5 @@ extern Eina_List* get_values_from_table_sync(const char* table_name, Eina_List*
 extern Eina_List* get_values_from_table_sync_order_by(const char* table_name, Eina_List* column_names, Eina_List* column_types, const char* order_column, Eina_Bool is_asc, const char* where_clause);
 extern Eina_Bool delete_record(char *tablename, const char* where_clause);
 extern Eina_Bool drop_table(char *tablename);
-extern int get_number_of_rows(char* table_name, char* where_clause);
+extern int get_number_of_rows(const char* table_name, char* where_clause);
 #endif /* TG_DB_MANAGER_H_ */
index efa6ec3..0e506c7 100644 (file)
@@ -2156,7 +2156,7 @@ void tgl_do_set_profile_name(struct tgl_state *TLS, const char *first_name, cons
        tglq_send_query(TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_profile_name_methods, 0, callback, callback_extra);
 }
 
-void tgl_do_set_username(struct tgl_state *TLS, char *name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra)
+void tgl_do_set_username(struct tgl_state *TLS, const char *name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra)
 {
        clear_packet();
        out_int(CODE_account_update_username);
@@ -4424,7 +4424,7 @@ void tgl_do_send_broadcast(struct tgl_state *TLS, int num, tgl_peer_id_t id[], c
 }
 
 /* {{{ block user */
-static int block_user_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+static int block_user_on_answer (struct tgl_state *TLS, struct query *q) {
   if (q->callback) {
     ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
   }
index 4160985..59218e9 100644 (file)
@@ -333,7 +333,7 @@ extern void tgl_do_send_video(struct tgl_state *TLS, int flags, tgl_peer_id_t to
 extern void tgl_do_set_chat_photo(struct tgl_state *TLS, tgl_peer_id_t chat_id, char *file_name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
 extern void tgl_do_set_profile_photo(struct tgl_state *TLS, char *file_name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
 extern void tgl_do_set_profile_name(struct tgl_state *TLS, const char *first_name, const char *last_name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
-extern void tgl_do_set_username(struct tgl_state *TLS, char *name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+extern void tgl_do_set_username(struct tgl_state *TLS, const char *name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
 extern void tgl_do_forward_message(struct tgl_state *TLS, tgl_peer_id_t id, int n, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
 extern void tgl_do_rename_chat(struct tgl_state *TLS, tgl_peer_id_t id, char *name, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
 extern void tgl_do_get_chat_info(struct tgl_state *TLS, tgl_peer_id_t id, int offline_mode, void(*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_chat *C), void *callback_extra);
index 7ad24f7..b5b4589 100644 (file)
@@ -395,9 +395,7 @@ static int _on_tg_server_msg_received_cb(void *data, bundle *const rec_msg)
 
                for (int count = 0 ; count < size ; count++) {
                        contact_data_s* contact = (contact_data_s*)malloc(sizeof(contact_data_s));
-                       contact->first_name = NULL;
-                       contact->last_name = NULL;
-                       contact->phone_number = NULL;
+                       memset(contact, 0, sizeof(contact_data_s));
 
                        char first_name_key[20];
                        snprintf(first_name_key, sizeof(first_name_key), "first_name_%d", count);
index 7bbdc69..513ea8c 100644 (file)
@@ -455,6 +455,7 @@ Eina_List* get_all_unsent_text_messages()
        EINA_LIST_FREE(unsent_msg_details, ts_msg) {
 
                sent_message_data_s* msg_info = (sent_message_data_s*)malloc(sizeof(sent_message_data_s));
+               memset(msg_info, 0, sizeof(sent_message_data_s));
 
                char *temp_app_name = (char*)eina_list_nth(ts_msg, 0);
                if (temp_app_name) {
@@ -558,6 +559,7 @@ Eina_List* get_all_unsent_media_messages()
        Eina_List* ts_msg = NULL;
        EINA_LIST_FREE(unsent_msg_details, ts_msg) {
                sent_media_data_s* msg_info = (sent_media_data_s*)malloc(sizeof(sent_media_data_s));
+               memset(msg_info, 0, sizeof(sent_message_data_s));
 
                char *temp_app_name = (char*)eina_list_nth(ts_msg, 0);
                if (temp_app_name) {
@@ -1114,6 +1116,7 @@ struct tgl_message* get_message_from_message_tableby_message_id(char *table_name
        if (message_details && eina_list_count(message_details) > 0) {
                ts_msg = eina_list_nth(message_details, 0);
                message = (struct tgl_message*)malloc(sizeof(struct tgl_message));
+               memset(message, 0, sizeof(struct tgl_message));
 
                int *temp_msg_id = (int*)eina_list_nth(ts_msg, 0);
                if (temp_msg_id) {
@@ -1528,6 +1531,7 @@ struct tgl_message* get_message_from_message_table(long long msg_id, char* table
        if (message_details && eina_list_count(message_details) > 0) {
                ts_msg = eina_list_nth(message_details, 0);
                message = (struct tgl_message*)malloc(sizeof(struct tgl_message));
+               memset(message, 0, sizeof(struct tgl_message));
 
                int *temp_msg_id = (int*)eina_list_nth(ts_msg, 0);
                if (temp_msg_id) {
@@ -3191,6 +3195,7 @@ struct tgl_media* get_media_details_from_db(long long media_id)
                return NULL;
 
        struct tgl_media* media_info = (struct tgl_media*)malloc(sizeof(struct tgl_media));
+       memset(media_info, 0, sizeof(struct tgl_media));
        Eina_List* row_vals = eina_list_nth(img_details, 0);
        char *temp_media_id = (char *)eina_list_nth(row_vals, 0);
 
index c8f567f..934bb07 100644 (file)
@@ -697,6 +697,7 @@ static Eina_Bool on_send_unsent_messages_requested(void *data)
        sent_media_data_s* media_info = NULL;
        EINA_LIST_FREE(unset_media_msgs, media_info) {
                sent_media_data_s* new_media_info = (sent_media_data_s*)malloc(sizeof(sent_media_data_s));
+               memset(new_media_info, 0, sizeof(sent_media_data_s));
                new_media_info->app_name = strdup(media_info->app_name);
                new_media_info->command = strdup(media_info->command);
                new_media_info->buddy_id = strdup(media_info->buddy_id);
@@ -1183,6 +1184,7 @@ void on_requested_chat_info_received(struct tgl_state *TLS, void *callback_extra
        if (msg_id > 0) {
                send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id));
                struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data));
+               memset(msg_data, 0, sizeof(struct tg_temp_msg_data));
                msg_data->M = M;
                msg_data->TLS = TLS;
                msg_data->send_timer = ecore_timer_add(1, on_msg_received_cb, msg_data);
@@ -1316,6 +1318,7 @@ void on_new_buddy_info_loaded(struct tgl_state *TLS, void *callback_extra, int s
                        send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id));
 
                        struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data));
+                       memset(msg_data, 0, sizeof(struct tg_temp_msg_data));
                        msg_data->M = M;
                        msg_data->TLS = TLS;
                        msg_data->send_timer = ecore_timer_add(3, on_msg_received_cb, msg_data);
@@ -1387,7 +1390,7 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M)
 
                                        char* msg_table = get_table_name_from_number(M->to_id.id);
                                        create_buddy_msg_table(msg_table);
-                                       int msg_id = insert_current_date_to_table(msg_table);
+                                       /* int msg_id = insert_current_date_to_table(msg_table); */
                                        free(msg_table);
                                        struct tgl_photo *pic = &(M->action.photo);
                                        if (pic) {
@@ -2416,7 +2419,7 @@ void on_new_group_icon_loaded(struct tgl_state *TLS, void *callback_extra, int s
 
                        char* msg_table = get_table_name_from_number(M->to_id.id);
                        create_buddy_msg_table(msg_table);
-                       int msg_id = insert_current_date_to_table(msg_table);
+                       /* int msg_id = insert_current_date_to_table(msg_table); */
 
                        tgl_peer_t* UC = tgl_peer_get(TLS, M->from_id);
                        int msg_len = strlen(UC->user.first_name) + strlen(" changed profile photo") + 1;
@@ -2467,7 +2470,7 @@ void on_new_group_created(struct tgl_state *TLS, void *callback_extra, int succe
                                create_buddy_msg_table(msg_table);
 
 
-                               int msg_id = insert_current_date_to_table(msg_table);
+                               /* int msg_id = insert_current_date_to_table(msg_table); */
                                //send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id,msg_id, tgl_get_peer_type(M->to_id));
 
 
@@ -2836,6 +2839,7 @@ void media_download_request(tg_engine_data_s *tg_data, int buddy_id, long long m
                } else if (img_details->media_type == tgl_message_media_photo) {
 
                        struct tgl_photo* photo_prop = (struct tgl_photo*)malloc(sizeof(struct tgl_photo));
+                       memset(photo_prop, 0, sizeof(struct tgl_photo));
                        photo_prop->id = img_details->media_id;
                        photo_prop->access_hash = img_details->access_hash;
                        photo_prop->user_id = img_details->user_id;
@@ -2921,6 +2925,7 @@ void media_download_request(tg_engine_data_s *tg_data, int buddy_id, long long m
 
                } else if (img_details->media_type == tgl_message_media_document) {
                        struct tgl_document* doc_prop = (struct tgl_document*)malloc(sizeof(struct tgl_document));
+                       memset(doc_prop, 0, sizeof(struct tgl_document));
                        doc_prop->id = img_details->media_id;;
                        doc_prop->access_hash = img_details->access_hash;
                        doc_prop->user_id = img_details->user_id;
@@ -3070,6 +3075,7 @@ void delete_all_messages_from_chat(int buddy_id, int type_of_chat)
 
        if (msg_ids && eina_list_count(msg_ids) > 0) {
                msg_list_container_s *msg_list_container = (msg_list_container_s*)malloc(sizeof(msg_list_container_s));
+               memset(msg_list_container, 0, sizeof(msg_list_container_s));
                msg_list_container->message_ids = msg_ids;
                msg_list_container->buddy_id = buddy_id;
                msg_list_container->current_index = 0;
@@ -3256,6 +3262,7 @@ void on_message_deleted(struct tgl_state *TLS, void *callback_extra, int success
 void do_delete_message(int buddy_id, int message_id)
 {
        msg_container_s *msg_details = (msg_container_s*)malloc(sizeof(msg_container_s));
+       memset(msg_details, 0, sizeof(msg_container_s));
        msg_details->buddy_id = buddy_id;
        msg_details->message_id = message_id;
        tgl_do_delete_msg(s_info.TLS, message_id, &on_message_deleted , (void*)(msg_details));
index 6fdc766..d71f514 100644 (file)
@@ -30,7 +30,7 @@ uint64_t get_time_stamp_in_macro()
        return tv.tv_sec*(uint64_t)1000000+tv.tv_usec;
 }
 
-void tg_notification_create(tg_engine_data_s* tg_data, char * icon_path, const char *title, char *content, char *sound_path, char *app_id)
+void tg_notification_create(tg_engine_data_s* tg_data, const char * icon_path, const char *title, char *content, char *sound_path, char *app_id)
 {
        if (tg_data && tg_data->s_notififcation)
                notification_delete_all(NOTIFICATION_TYPE_NOTI);
index 64183c0..8f2cebc 100644 (file)
@@ -56,7 +56,7 @@ extern char *get_table_name_from_number(const int id);
 
 extern char *replace(const char *s, char ch, const char *repl);
 
-extern void tg_notification_create(tg_engine_data_s* tg_data, char * icon_path, const char *title, char *content, char *sound_path, char *app_id);
+extern void tg_notification_create(tg_engine_data_s* tg_data, const char * icon_path, const char *title, char *content, char *sound_path, char *app_id);
 
 extern void display_badge_with_notification(int unread_msg_cnt, tg_engine_data_s* tg_data);