diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-09-18 04:31:36 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-09-18 04:31:36 +0800 |
commit | 79ec5b35a834e63ef1713a8ed58f8c394db35dfe (patch) | |
tree | 172e6e84d67c635609fab26da4b7389cd15837b0 /my-evolution/e-summary-calendar.c | |
parent | 10f836d32aadb7e5207579095da74ecb97e533be (diff) | |
download | gsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.tar.gz gsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.tar.zst gsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.zip |
Fix the use of qsort
svn path=/trunk/; revision=12906
Diffstat (limited to 'my-evolution/e-summary-calendar.c')
-rw-r--r-- | my-evolution/e-summary-calendar.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index 789cff124a..85c14546b0 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -51,10 +51,14 @@ e_summary_calendar_event_sort_func (const void *e1, { ESummaryCalEvent *event1, *event2; - event1 = (ESummaryCalEvent *) e1; - event2 = (ESummaryCalEvent *) e2; + event1 = *(ESummaryCalEvent **) e1; + event2 = *(ESummaryCalEvent **) e2; - return icaltime_compare (*event1->dt.value, *event2->dt.value); + if (event1->dt.value == NULL || event2->dt.value == NULL) { + return 0; + } + + return icaltime_compare (*(event1->dt.value), *(event2->dt.value)); } static GPtrArray * @@ -95,7 +99,7 @@ uids_to_array (ESummary *summary, g_ptr_array_add (array, event); } - qsort (array->pdata, array->len, sizeof (ESummaryCalEvent), e_summary_calendar_event_sort_func); + qsort (array->pdata, array->len, sizeof (ESummaryCalEvent *), e_summary_calendar_event_sort_func); return array; } |