aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-23 14:14:03 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-23 14:14:03 +0800
commitf14ab0afa345a49816beb215a1b3e2042c13ec40 (patch)
treec91d3128bbc978f1a8d7df6bf85d737cc8d8620b /plugins/itip-formatter
parent779f0e51a43643d7ff762fcb5553f607eab63e7e (diff)
downloadgsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar.gz
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar.bz2
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar.lz
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar.xz
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.tar.zst
gsoc2013-evolution-f14ab0afa345a49816beb215a1b3e2042c13ec40.zip
** Fix for bug #350395 by Øystein Gisnås
svn path=/trunk/; revision=32635
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r--plugins/itip-formatter/ChangeLog7
-rw-r--r--plugins/itip-formatter/itip-view.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog
index c38d2e7694..ddaf22984b 100644
--- a/plugins/itip-formatter/ChangeLog
+++ b/plugins/itip-formatter/ChangeLog
@@ -1,3 +1,10 @@
+2006-08-23 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #350395 by Øystein Gisnås
+
+ * itip-view.c: (format_date_and_time_x): The patch adds some extra
+ checks to avoid the crash.
+
2006-08-18 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #328268
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index 64cb01f1ef..3d644eca93 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -150,7 +150,8 @@ format_date_and_time_x (struct tm *date_tm,
/* Calculate a normalized "tomorrow" */
tomorrow_tm = *current_tm;
- if (tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) {
+ /* Don't need this if date is in the past. Also, year assumption won't fail. */
+ if (date_tm->tm_year >= current_tm->tm_year && tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) {
tomorrow_tm.tm_mday = 1;
if (tomorrow_tm.tm_mon == 11) {
tomorrow_tm.tm_mon = 1;
@@ -164,7 +165,8 @@ format_date_and_time_x (struct tm *date_tm,
/* Calculate a normalized "next seven days" */
week_tm = *current_tm;
- if (week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) {
+ /* Don't need this if date is in the past. Also, year assumption won't fail. */
+ if (date_tm->tm_year >= current_tm->tm_year && week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) {
week_tm.tm_mday = (week_tm.tm_mday + 6) % time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon);
if (week_tm.tm_mon == 11) {
week_tm.tm_mon = 1;