summaryrefslogtreecommitdiff
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-10 14:55:14 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-10 15:40:47 -0400
commitf6d703c395745f9ff287cf7965b540f10c79186a (patch)
tree4e7699c972098fa401c6c384b0c5695c2a07b056 /src/basic/strv.c
parentb1aa5ced45951ed470188b362c61827fb31da2ab (diff)
downloadsystemd-f6d703c395745f9ff287cf7965b540f10c79186a.tar.gz
basic/strv: use existing qsort_safe() helper
strv_sort() predates qsort_safe(), but we can convert it to it to save a few lines.
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 0eec868eed..c63f11c6ad 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -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;
}