Tizen 2.4.0 rev3 SDK Public Release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20160307.020036 submit/tizen_2.4/20160306.235759
authorjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 10:50:37 +0000 (19:50 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 10:50:37 +0000 (19:50 +0900)
common/cal_vcalendar_make.c
common/cal_vcalendar_parse.c
packaging/calendar-service.spec

index cfa93fb..502b19a 100644 (file)
@@ -507,34 +507,31 @@ static void _cal_vcalendar_make_alarm(cal_make_s *b, calendar_record_h alarm)
 
 int _cal_vcalendar_make_rrule_append_mday(char *buf, int buf_len, char *mday)
 {
-       int i;
-       int num;
-       int length = 0;
-       char **t = NULL;
-       char *p = NULL;
+       int ret = 0;
 
-       RETV_IF(NULL == buf, CALENDAR_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == mday, CALENDAR_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == buf, 0);
+       RETV_IF(NULL == mday, 0);
 
+       char **t = NULL;
        t = g_strsplit_set(mday, " ,", -1);
        if (!t) {
                ERR("g_strsplit_set() Fail");
                g_strfreev(t);
-               return CALENDAR_ERROR_OUT_OF_MEMORY;
+               return 0;
        }
        int len = strlen(buf);
-       length = g_strv_length(t);
-       for (i = 0; i < length; i++) {
+       int tlen = g_strv_length(t);
+       int i;
+       for (i = 0; i < tlen; i++) {
                if (*t[i] == '\0')
                        continue;
 
-               p = t[i];
-               num = atoi(p);
-               len += snprintf(buf +len, buf_len -len, "%d%s ", num, 0 < num? "": "-");
+               int num = atoi(t[i]);
+               ret += snprintf(buf +len +ret, buf_len -len -ret, "%d%s", num, 0 < num? " ": "- ");
        }
        g_strfreev(t);
 
-       return CALENDAR_ERROR_NONE;
+       return ret;
 }
 
 static void _cal_vcalendar_make_rrule_append_setpos(calendar_record_h record, char *buf, int buf_len)
@@ -988,9 +985,9 @@ static void __make_rrule_ver1(cal_make_s *b, calendar_record_h record)
        switch (freq) {
        case CALENDAR_RECURRENCE_YEARLY:
                if (bymonth && *bymonth) {
-                       DBG("bymonth");
+                       DBG("bymonth[%s]", bymonth);
                        len += snprintf(buf +len, sizeof(buf) -len, "YM%d ", interval);
-                       _cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonth);
+                       len +=_cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonth);
 
                        if (byday && *byday) {
                                DBG("byday");
index 69497a3..3ae65b3 100644 (file)
@@ -1565,7 +1565,9 @@ static void __work_component_property_rrule_ver_1(char *value, calendar_record_h
 
        int i;
        for (i = 0; i < len; i++) {
-               if (NULL == t[i] || '\0' == *t[i]) continue;
+               if (NULL == t[i] || '\0' == *t[i])
+                       continue;
+
                DBG("[%s]", t[i]);
 
                if (true == __is_wday_string(t[i])) {
index 266429d..f16a3fa 100644 (file)
@@ -1,6 +1,6 @@
 Name:       calendar-service
 Summary:    DB library for calendar
-Version:    0.1.158
+Version:    0.1.159
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0