aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2019-05-12 21:52:13 +0200
committerDave Andreoli <dave@gurumeditation.it>2019-05-12 21:52:13 +0200
commit65bd9f748bc53b41218dbac90b7900a2123f9d7b (patch)
treeb070835e421a027943a7664f258b59a440feeac2
parentFix compilation on recent efl (read as: breackage) (diff)
downloadplaces-65bd9f748bc53b41218dbac90b7900a2123f9d7b.tar.gz
Make coverity happy
-rw-r--r--src/e_mod_places.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/e_mod_places.c b/src/e_mod_places.c
index b22935a..ce60a78 100644
--- a/src/e_mod_places.c
+++ b/src/e_mod_places.c
@@ -184,6 +184,9 @@ _places_volume_sort_cb(const void *d1, const void *d2)
const Volume *v1 = d1;
const Volume *v2 = d2;
+ if(!v1) return(1);
+ if(!v2) return(-1);
+
// removable after interal
if (v1->removable && !v2->removable) return(1);
if (v2->removable && !v1->removable) return(-1);
@@ -191,8 +194,8 @@ _places_volume_sort_cb(const void *d1, const void *d2)
if (v1->mount_point && !strcmp(v1->mount_point, "/")) return -1;
if (v2->mount_point && !strcmp(v2->mount_point, "/")) return 1;
// order by label
- if(!v1 || !v1->label) return(1);
- if(!v2 || !v2->label) return(-1);
+ if(!v1->label) return(1);
+ if(!v2->label) return(-1);
return strcmp(v1->label, v2->label);
}