From f6d703c395745f9ff287cf7965b540f10c79186a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Jul 2017 14:55:14 -0400 Subject: basic/strv: use existing qsort_safe() helper strv_sort() predates qsort_safe(), but we can convert it to it to save a few lines. --- src/basic/strv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') 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; } -- cgit v1.2.1