Fix a potential bug in vcalendar's libical.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 9 Aug 2016 21:38:32 +0000 (23:38 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 9 Aug 2016 21:38:32 +0000 (23:38 +0200)
Some compilers seem to understand this construction as an empty
for() cycle, followed by an unrelated block enclosed in braces.
We make sure the compiler does what we want by putting the
opening brace at the same line as for().

src/plugins/vcalendar/libical/libical/icalrecur.c

index 9d3c96d..09ed9c0 100644 (file)
@@ -1743,8 +1743,7 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
         /* FREQ=YEARLY; BYMONTHDAY=1,15; BYMONTH=10 */
 
         for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){
-            for(k=0;impl->by_ptrs[BY_MONTH_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++)
-           {
+            for(k=0;impl->by_ptrs[BY_MONTH_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){
                 short month = impl->by_ptrs[BY_MONTH][j];
                 short month_day = impl->by_ptrs[BY_MONTH_DAY][k];
                 short doy;