aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-06-05 09:13:53 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-06-05 09:13:53 +0000
commitb055e9771b979f98b4b3237ce8d98f75c56b988c (patch)
treeeb0001c1a91cc585089aee363862fc27359ea579 /libsylph
parent64ee31624d3493f00864031c35fa3ab7fdce0bf3 (diff)
fixed crash on 32-bit OS with 64-bit time_t.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3405 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/filter.c7
1 files changed, 4 insertions, 3 deletions
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);