aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libical/ChangeLog5
-rw-r--r--libical/src/libical/icaltime.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index bae7663efa..e24a36208f 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,5 +1,10 @@
2001-07-09 Damon Chaplin <damon@ximian.com>
+ * src/libical/icaltime.c (icaltime_adjust): forgot to compile before
+ committing. Idiot.
+
+2001-07-09 Damon Chaplin <damon@ximian.com>
+
* src/libical/icaltimezone.c (icaltimezone_convert_time): if the 2
zones are the same just return.
diff --git a/libical/src/libical/icaltime.c b/libical/src/libical/icaltime.c
index e3229c6925..6c720b7941 100644
--- a/libical/src/libical/icaltime.c
+++ b/libical/src/libical/icaltime.c
@@ -587,7 +587,7 @@ icaltime_adjust (struct icaltimetype *tt,
int seconds)
{
int second, minute, hour, day;
- int minutes_overflow, hours_overflow, days_overflow;
+ int minutes_overflow, hours_overflow, days_overflow, years_overflow;
int days_in_month;
/* Add on the seconds. */
@@ -621,12 +621,12 @@ icaltime_adjust (struct icaltimetype *tt,
need to know what month it is to get the number of days in it.
Note that months are 1 to 12, so we have to be a bit careful. */
if (tt->month >= 13) {
- years_overflow = (month - 1) / 12;
+ years_overflow = (tt->month - 1) / 12;
tt->year += years_overflow;
tt->month -= years_overflow * 12;
} else if (tt->month <= 0) {
/* 0 to -11 is -1 year out, -12 to -23 is -2 years. */
- years_overflow = (month / 12) - 1;
+ years_overflow = (tt->month / 12) - 1;
tt->year += years_overflow;
tt->month -= years_overflow * 12;
}