Fix svace issue (WGID 308150) 73/197873/3 tizen_5.0 submit/tizen_5.0/20190118.015410
authorsinikang <sinikang@samsung.com>
Thu, 11 Oct 2018 02:08:28 +0000 (11:08 +0900)
committersinikang <sinikang@samsung.com>
Thu, 17 Jan 2019 08:05:43 +0000 (17:05 +0900)
Change-Id: I98ba5a2577d2e501d60d55c3da4d66a425bb1ce7
(cherry picked from commit 7ffd742b00c66adf7c3124ea061b4386d109119f)

packaging/tel-plugin-nitz.spec
src/time_update.c

index bdc469b..b4fb1f1 100644 (file)
@@ -3,7 +3,7 @@
 
 %define major 0
 %define minor 1
-%define patchlevel 79
+%define patchlevel 80
 
 Name:       tel-plugin-nitz
 Summary:    nitz plugin for telephony
index 9b2d744..218a263 100644 (file)
@@ -223,7 +223,7 @@ static gboolean __update_timezone_by_offset(const struct tnoti_network_timeinfo
        } else {
                UChar utf16_timezone[NITZ_TIMEZONE_MAX_LEN] = { 0 };
                UCalendar *cal = NULL;
-               gboolean in_dst = FALSE;
+               int in_dst = 0;
                UErrorCode ec = U_ZERO_ERROR;
                GList *list = NULL;
 
@@ -239,7 +239,7 @@ static gboolean __update_timezone_by_offset(const struct tnoti_network_timeinfo
                                }
                                in_dst = ucal_inDaylightTime(cal, &ec);
                                dbg("TZ DST:[%d] WANTED DST:[%d][%d]", in_dst, ti->isdst, ti->dstoff);
-                               if (ti->dstoff == (int)in_dst) {
+                               if (ti->dstoff == in_dst) {
                                        found = TRUE;
                                        info("(%s) was selected", timezone_name);
                                        ucal_close(cal);
@@ -311,7 +311,7 @@ GList * nitz_get_tzlist(char *iso)
        const UChar* timezone_id = 0;
        int timezone_id_len = 0;
        int offset = 0;
-       gboolean in_dst = 0;
+       int in_dst = 0;
        GList *tz_list = NULL;
        UCalendar *cal = NULL;
        unsigned int offset_hash = 0;
@@ -329,7 +329,9 @@ GList * nitz_get_tzlist(char *iso)
                        break;
 
                cal = ucal_open(timezone_id, u_strlen(timezone_id), uloc_getDefault(), UCAL_TRADITIONAL, &ec);
-               in_dst = ucal_inDaylightTime(cal, &ec);
+               if (ucal_inDaylightTime(cal, &ec) == TRUE)
+                       in_dst = 1;
+
                offset = ucal_get(cal, UCAL_ZONE_OFFSET, &ec);
                offset_hash = (offset/1800000) + 24;
                ucal_close(cal);