# HG changeset patch # User Mike Becker # Date 1726609035 -7200 # Node ID 6f44b1f1275c0705f8c67f23589261607ce012ca # Parent e5181fe13b9c0c6b6f4ac323aff341061580afd8 fix for empty arrays relates to #424 diff -r e5181fe13b9c -r 6f44b1f1275c src/array_list.c --- a/src/array_list.c Tue Sep 17 23:32:27 2024 +0200 +++ b/src/array_list.c Tue Sep 17 23:37:15 2024 +0200 @@ -243,6 +243,9 @@ void const *elem, cx_compare_func cmp_func ) { + // special case: empty array + if (size == 0) return 0; + // declare a variable that will contain the compare results int result;