diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2014-06-05 09:13:53 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2014-06-05 09:13:53 +0000 |
commit | b055e9771b979f98b4b3237ce8d98f75c56b988c (patch) | |
tree | eb0001c1a91cc585089aee363862fc27359ea579 | |
parent | 64ee31624d3493f00864031c35fa3ab7fdce0bf3 (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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libsylph/filter.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -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); |