diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-07-10 14:55:14 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-07-10 15:40:47 -0400 |
commit | f6d703c395745f9ff287cf7965b540f10c79186a (patch) | |
tree | 4e7699c972098fa401c6c384b0c5695c2a07b056 /src | |
parent | b1aa5ced45951ed470188b362c61827fb31da2ab (diff) | |
download | systemd-f6d703c395745f9ff287cf7965b540f10c79186a.tar.gz systemd-f6d703c395745f9ff287cf7965b540f10c79186a.tar.bz2 systemd-f6d703c395745f9ff287cf7965b540f10c79186a.zip |
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')
-rw-r--r-- | src/basic/strv.c | 6 |
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; } |