From 9ed0d8d6e6de7737fe9a658446318b86e57c6fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 29 Sep 2016 17:27:31 +0200 Subject: use QSORT Apply the semantic patch contrib/coccinelle/qsort.cocci to the code base, replacing calls of qsort(3) with QSORT. The resulting code is shorter and supports empty arrays with NULL pointers. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- string-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string-list.c') diff --git a/string-list.c b/string-list.c index 62d20846c..8c83cac18 100644 --- a/string-list.c +++ b/string-list.c @@ -225,7 +225,7 @@ static int cmp_items(const void *a, const void *b) void string_list_sort(struct string_list *list) { compare_for_qsort = list->cmp ? list->cmp : strcmp; - qsort(list->items, list->nr, sizeof(*list->items), cmp_items); + QSORT(list->items, list->nr, cmp_items); } struct string_list_item *unsorted_string_list_lookup(struct string_list *list, -- cgit v1.2.1