diff 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
line wrap: on
line diff
--- a/src/audacious/pluginenum.c	Fri May 25 00:28:41 2007 -0700
+++ b/src/audacious/pluginenum.c	Fri May 25 01:35:44 2007 -0700
@@ -63,35 +63,50 @@
 inputlist_compare_func(gconstpointer a, gconstpointer b)
 {
     const InputPlugin *ap = a, *bp = b;
-    return strcasecmp(ap->description, bp->description);
+    if(ap->description && bp->description)
+        return strcasecmp(ap->description, bp->description);
+    else
+        return 0;
 }
 
 static gint
 outputlist_compare_func(gconstpointer a, gconstpointer b)
 {
     const OutputPlugin *ap = a, *bp = b;
-    return strcasecmp(ap->description, bp->description);
+    if(ap->description && bp->description)
+        return strcasecmp(ap->description, bp->description);
+    else
+        return 0;
 }
 
 static gint
 effectlist_compare_func(gconstpointer a, gconstpointer b)
 {
     const EffectPlugin *ap = a, *bp = b;
-    return strcasecmp(ap->description, bp->description);
+    if(ap->description && bp->description)
+        return strcasecmp(ap->description, bp->description);
+    else
+        return 0;
 }
 
 static gint
 generallist_compare_func(gconstpointer a, gconstpointer b)
 {
     const GeneralPlugin *ap = a, *bp = b;
-    return strcasecmp(ap->description, bp->description);
+    if(ap->description && bp->description)
+        return strcasecmp(ap->description, bp->description);
+    else
+        return 0;
 }
 
 static gint
 vislist_compare_func(gconstpointer a, gconstpointer b)
 {
     const VisPlugin *ap = a, *bp = b;
-    return strcasecmp(ap->description, bp->description);
+    if(ap->description && bp->description)
+        return strcasecmp(ap->description, bp->description);
+    else
+        return 0;
 }
 
 static gboolean