fixed svace defects 18/100518/1 accepted/tizen/3.0/mobile/20161129.001910 submit/tizen_3.0/20161128.050643
authorKyoungyong Lee <k.y.lee@samsung.com>
Mon, 28 Nov 2016 10:08:29 +0000 (19:08 +0900)
committerKyoungyong Lee <k.y.lee@samsung.com>
Mon, 28 Nov 2016 10:08:34 +0000 (19:08 +0900)
Change-Id: I6621a8cabf45b86ebaef297d83b9a274af758f99

ui/src/privacy_guard_package_list_view.c

index aa350f1..7a5b881 100644 (file)
@@ -204,7 +204,7 @@ void create_privacy_guard_package_list_view(struct app_data_s* ad)
                        pg_data_s* data = (pg_data_s*)l->data;
                        char str_temp[256] = {'\0',};
                        char str_time[32] = {'\0',};
-                       struct tm *timeinfo = NULL;
+                       struct tm timeinfo;
                        char *label = NULL;
                        char* icon = NULL;
                        pkgmgrinfo_pkginfo_h handle;
@@ -236,9 +236,10 @@ void create_privacy_guard_package_list_view(struct app_data_s* ad)
 
                        // description - e.g.) 25/08/2010 01:30 PM 21 time(s)
                        if (data->time > 0) {
-                               timeinfo = localtime(&data->time);
-                               LOGD("time : %s", asctime(timeinfo));
-                               strftime (str_time, 32, "%d/%m/%Y %I:%M %p", timeinfo);
+                               localtime_r(&data->time, &timeinfo);
+                               char buf[32];
+                               LOGD("time: %s", asctime_r(&timeinfo, buf));
+                               strftime (str_time, 32, "%d/%m/%Y %I:%M %p", &timeinfo);
                                char *str_count = dgettext("privacy-setting", "IDS_CLD_BODY_PD_TIMES");
                                snprintf(str_temp, sizeof(str_temp), str_count, data->count);
                                snprintf(str_label, sizeof(str_label), "<font_size=27>%s <font color=#3DB9CCFF>%s</font></font_size>", str_time, str_temp);
@@ -262,8 +263,7 @@ void create_privacy_guard_package_list_view(struct app_data_s* ad)
                        } else {
                                if (EINA_TRUE == ecore_file_exists(icon)) {
                                        item->icon = strdup(icon);
-                               }
-                               else {
+                               } else {
                                        LOGD("The icon is not exist for %s. So replace it to the default icon.", label);
                                        item->icon = strdup(DEFAULT_ICON_PATH);
                                }