diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-10 05:28:40 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-10 05:28:40 +0000 |
commit | 8f727571f7719045938ec876c4441ed4c6ef8119 (patch) | |
tree | b63919316d1835d20a33313096d2bc568285bf5f /src | |
parent | 48f1078ba5251ebe3bdd07765c94d1f38bc87900 (diff) |
fixed possible crash (take 2).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@329 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/summaryview.c | 42 |
1 files changed, 21 insertions, 21 deletions
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); } |