From b055e9771b979f98b4b3237ce8d98f75c56b988c Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 5 Jun 2014 09:13:53 +0000 Subject: 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 --- ChangeLog | 5 +++++ libsylph/filter.c | 7 ++++--- 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); -- cgit v1.2.3