tree-wide: use typesafe_qsort()

This commit is contained in:
Yu Watanabe
2018-09-19 08:02:52 +09:00
parent 6058516a14
commit 93bab28895
35 changed files with 243 additions and 374 deletions
+2 -4
View File
@@ -711,14 +711,12 @@ bool strv_overlap(char **a, char **b) {
return false;
}
static int str_compare(const void *_a, const void *_b) {
const char **a = (const char**) _a, **b = (const char**) _b;
static int str_compare(char * const *a, char * const *b) {
return strcmp(*a, *b);
}
char **strv_sort(char **l) {
qsort_safe(l, strv_length(l), sizeof(char*), str_compare);
typesafe_qsort(l, strv_length(l), str_compare);
return l;
}