aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libsylph/filter.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 116cdfba..1931f0b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-05
+
+ * libsylph/filter.c: filter_match_cond(): fixed crash on 32-bit OS
+ with 64-bit time_t.
+
2014-04-25
* makewin32.sh: added -static-libgcc option to prevent the dependency
diff --git a/libsylph/filter.c b/libsylph/filter.c
index 813ed329..63d35bb0 100644
--- a/libsylph/filter.c
+++ b/libsylph/filter.c
@@ -457,6 +457,7 @@ static gboolean filter_match_cond(FilterCond *cond, MsgInfo *msginfo,
gint ret;
gboolean matched = FALSE;
gboolean not_match = FALSE;
+ gint64 timediff = 0;
gchar *file;
gchar *cmdline;
PrefsAccount *cond_ac;
@@ -495,8 +496,8 @@ static gboolean filter_match_cond(FilterCond *cond, MsgInfo *msginfo,
matched = (msginfo->size > cond->int_value * 1024);
break;
case FLT_COND_AGE_GREATER:
- matched = (time(NULL) - msginfo->date_t >
- cond->int_value * 24 * 60 * 60);
+ timediff = time(NULL) - msginfo->date_t;
+ matched = (timediff > cond->int_value * 24 * 60 * 60);
break;
case FLT_COND_UNREAD:
matched = MSG_IS_UNREAD(msginfo->flags);
@@ -541,7 +542,7 @@ static gboolean filter_match_cond(FilterCond *cond, MsgInfo *msginfo,
debug_print("filter-log: %s: SIZE_GREATER: %u %s %d (KB)%s\n", G_STRFUNC, msginfo->size, not_match ? "<=" : ">", cond->int_value, nm);
break;
case FLT_COND_AGE_GREATER:
- debug_print("filter-log: %s: AGE_GREATER: %ld (sec) %s %d (day)%s\n", G_STRFUNC, time(NULL) - msginfo->date_t, not_match ? "<=" : ">", cond->int_value, nm);
+ debug_print("filter-log: %s: AGE_GREATER: %lld (sec) %s %d (day)%s\n", G_STRFUNC, timediff, not_match ? "<=" : ">", cond->int_value, nm);
break;
case FLT_COND_UNREAD:
debug_print("filter-log: %s: UNREAD%s\n", G_STRFUNC, nm);