comparison src/audacious/pluginenum.c @ 2804:d5c77e670be0 trunk

[svn] - temporal fix for crash in compare_func().
author yaz
date Fri, 25 May 2007 01:35:44 -0700
parents 8ab12f092722
children 5bd949bbd1c7
comparison
equal deleted inserted replaced
2803:2d915b3e3e52 2804:d5c77e670be0
61 61
62 static gint 62 static gint
63 inputlist_compare_func(gconstpointer a, gconstpointer b) 63 inputlist_compare_func(gconstpointer a, gconstpointer b)
64 { 64 {
65 const InputPlugin *ap = a, *bp = b; 65 const InputPlugin *ap = a, *bp = b;
66 return strcasecmp(ap->description, bp->description); 66 if(ap->description && bp->description)
67 return strcasecmp(ap->description, bp->description);
68 else
69 return 0;
67 } 70 }
68 71
69 static gint 72 static gint
70 outputlist_compare_func(gconstpointer a, gconstpointer b) 73 outputlist_compare_func(gconstpointer a, gconstpointer b)
71 { 74 {
72 const OutputPlugin *ap = a, *bp = b; 75 const OutputPlugin *ap = a, *bp = b;
73 return strcasecmp(ap->description, bp->description); 76 if(ap->description && bp->description)
77 return strcasecmp(ap->description, bp->description);
78 else
79 return 0;
74 } 80 }
75 81
76 static gint 82 static gint
77 effectlist_compare_func(gconstpointer a, gconstpointer b) 83 effectlist_compare_func(gconstpointer a, gconstpointer b)
78 { 84 {
79 const EffectPlugin *ap = a, *bp = b; 85 const EffectPlugin *ap = a, *bp = b;
80 return strcasecmp(ap->description, bp->description); 86 if(ap->description && bp->description)
87 return strcasecmp(ap->description, bp->description);
88 else
89 return 0;
81 } 90 }
82 91
83 static gint 92 static gint
84 generallist_compare_func(gconstpointer a, gconstpointer b) 93 generallist_compare_func(gconstpointer a, gconstpointer b)
85 { 94 {
86 const GeneralPlugin *ap = a, *bp = b; 95 const GeneralPlugin *ap = a, *bp = b;
87 return strcasecmp(ap->description, bp->description); 96 if(ap->description && bp->description)
97 return strcasecmp(ap->description, bp->description);
98 else
99 return 0;
88 } 100 }
89 101
90 static gint 102 static gint
91 vislist_compare_func(gconstpointer a, gconstpointer b) 103 vislist_compare_func(gconstpointer a, gconstpointer b)
92 { 104 {
93 const VisPlugin *ap = a, *bp = b; 105 const VisPlugin *ap = a, *bp = b;
94 return strcasecmp(ap->description, bp->description); 106 if(ap->description && bp->description)
107 return strcasecmp(ap->description, bp->description);
108 else
109 return 0;
95 } 110 }
96 111
97 static gboolean 112 static gboolean
98 plugin_is_duplicate(const gchar * filename) 113 plugin_is_duplicate(const gchar * filename)
99 { 114 {