From a185a2fe0710e5ed943f7786119a3a0f4473b844 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 10 Jul 2017 14:55:14 -0400 Subject: [PATCH] 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(-) diff --git a/src/basic/strv.c b/src/basic/strv.c index c2defbe97..f0c764b17 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -782,11 +782,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; } -- 2.30.2