From bc6feeb99b7616ac34577e97e0adcfa471a9ab16 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 10 Feb 2010 09:49:44 +0000 Subject: fixed crash. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2463 ee746299-78ed-0310-b773-934348b2243d --- libsylph/filter.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/libsylph/filter.c b/libsylph/filter.c index 35bb9369..f9ac6984 100644 --- a/libsylph/filter.c +++ b/libsylph/filter.c @@ -874,7 +874,7 @@ void filter_write_file(GSList *list, const gchar *file) FilterRule *rule = (FilterRule *)cur->data; GSList *cur_cond; GSList *cur_action; - gchar match_type[16]; + gchar match_type[64]; gchar nstr[16]; fputs(" fp); @@ -895,24 +895,27 @@ void filter_write_file(GSList *list, const gchar *file) switch (cond->match_type) { case FLT_CONTAIN: - strcpy(match_type, - FLT_IS_NOT_MATCH(cond->match_flag) - ? "not-contain" : "contains"); + strncpy2(match_type, + FLT_IS_NOT_MATCH(cond->match_flag) + ? "not-contain" : "contains", + sizeof(match_type)); break; case FLT_EQUAL: - strcpy(match_type, - FLT_IS_NOT_MATCH(cond->match_flag) - ? "is-not" : "is"); + strncpy2(match_type, + FLT_IS_NOT_MATCH(cond->match_flag) + ? "is-not" : "is", sizeof(match_type)); break; case FLT_REGEX: - strcpy(match_type, - FLT_IS_NOT_MATCH(cond->match_flag) - ? "not-regex" : "regex"); + strncpy2(match_type, + FLT_IS_NOT_MATCH(cond->match_flag) + ? "not-regex" : "regex", + sizeof(match_type)); break; case FLT_IN_ADDRESSBOOK: - strcpy(match_type, - FLT_IS_NOT_MATCH(cond->match_flag) - ? "not-in-addressbook" : "in-addressbook"); + strncpy2(match_type, + FLT_IS_NOT_MATCH(cond->match_flag) + ? "not-in-addressbook" : "in-addressbook", + sizeof(match_type)); break; default: match_type[0] = '\0'; -- cgit v1.2.3