aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-10 09:49:44 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-10 09:49:44 +0000
commitbc6feeb99b7616ac34577e97e0adcfa471a9ab16 (patch)
tree1231d72d83fcd1ab165e9b5f9777e67f24e2c262
parente355f6a275f2987aa18417fa49ca8284d9db0775 (diff)
fixed crash.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2463 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--libsylph/filter.c29
1 files 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(" <rule name=\"", pfile->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';