basic/strv: use existing qsort_safe() helper

strv_sort() predates qsort_safe(), but we can convert it to it to
save a few lines.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-07-10 14:55:14 -04:00
parent b1aa5ced45
commit f6d703c395
1 changed files with 1 additions and 5 deletions

View File

@ -770,11 +770,7 @@ static int str_compare(const void *_a, const void *_b) {
}
char **strv_sort(char **l) {
if (strv_isempty(l))
return l;
qsort(l, strv_length(l), sizeof(char*), str_compare);
qsort_safe(l, strv_length(l), sizeof(char*), str_compare);
return l;
}