aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-06-10 05:28:40 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-06-10 05:28:40 +0000
commit8f727571f7719045938ec876c4441ed4c6ef8119 (patch)
treeb63919316d1835d20a33313096d2bc568285bf5f
parent48f1078ba5251ebe3bdd07765c94d1f38bc87900 (diff)
fixed possible crash (take 2).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@329 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.ja4
-rw-r--r--src/summaryview.c42
3 files changed, 29 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c2de2f2..165d701d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2005-06-10
+ * src/summaryview.c: fixed possible crash (take 2).
+
+2005-06-10
+
* src/summaryview.c: fixed possible crash when sorted by
From/To/Subject.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 0d8c7a53..c00adf05 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,9 @@
2005-06-10
+ * src/summaryview.c: クラッシュする可能性があったのを修正(take 2)。
+
+2005-06-10
+
* src/summaryview.c: From/To/Subject でソートしたときにクラッシュする
可能性があったのを修正。
diff --git a/src/summaryview.c b/src/summaryview.c
index 34e758eb..4043f4b5 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4705,7 +4705,7 @@ static void summary_drag_data_get(GtkWidget *widget,
static gint func_name(GtkTreeModel *model, \
GtkTreeIter *a, GtkTreeIter *b, gpointer data) \
{ \
- MsgInfo *msginfo_a, *msginfo_b; \
+ MsgInfo *msginfo_a = NULL, *msginfo_b = NULL; \
\
gtk_tree_model_get(model, a, S_COL_MSG_INFO, &msginfo_a, -1); \
gtk_tree_model_get(model, b, S_COL_MSG_INFO, &msginfo_b, -1); \
@@ -4735,7 +4735,7 @@ CMP_FUNC_DEF(summary_cmp_by_date, msginfo_a->date_t - msginfo_b->date_t)
static gint func_name(GtkTreeModel *model, \
GtkTreeIter *a, GtkTreeIter *b, gpointer data) \
{ \
- MsgInfo *msginfo_a, *msginfo_b; \
+ MsgInfo *msginfo_a = NULL, *msginfo_b = NULL; \
\
gtk_tree_model_get(model, a, S_COL_MSG_INFO, &msginfo_a, -1); \
gtk_tree_model_get(model, b, S_COL_MSG_INFO, &msginfo_b, -1); \
@@ -4756,23 +4756,23 @@ CMP_FUNC_DEF(summary_cmp_by_to, to);
#undef CMP_FUNC_DEF
-static gint summary_cmp_by_subject(GtkTreeModel *model, \
- GtkTreeIter *a, GtkTreeIter *b, \
- gpointer data) \
-{ \
- MsgInfo *msginfo_a, *msginfo_b; \
- \
- gtk_tree_model_get(model, a, S_COL_MSG_INFO, &msginfo_a, -1); \
- gtk_tree_model_get(model, b, S_COL_MSG_INFO, &msginfo_b, -1); \
- \
- if (!msginfo_a || !msginfo_b) \
- return 0; \
- \
- if (msginfo_a->subject == NULL) \
- return -(msginfo_b->subject != NULL); \
- if (msginfo_b->subject == NULL) \
- return (msginfo_a->subject != NULL); \
- \
- return subject_compare_for_sort \
- (msginfo_a->subject, msginfo_b->subject); \
+static gint summary_cmp_by_subject(GtkTreeModel *model,
+ GtkTreeIter *a, GtkTreeIter *b,
+ gpointer data)
+{
+ MsgInfo *msginfo_a = NULL, *msginfo_b = NULL;
+
+ gtk_tree_model_get(model, a, S_COL_MSG_INFO, &msginfo_a, -1);
+ gtk_tree_model_get(model, b, S_COL_MSG_INFO, &msginfo_b, -1);
+
+ if (!msginfo_a || !msginfo_b)
+ return 0;
+
+ if (msginfo_a->subject == NULL)
+ return -(msginfo_b->subject != NULL);
+ if (msginfo_b->subject == NULL)
+ return (msginfo_a->subject != NULL);
+
+ return subject_compare_for_sort
+ (msginfo_a->subject, msginfo_b->subject);
}