diff --git a/libluna/src/Sort.cpp b/libluna/src/Sort.cpp index 83015c18..c7fddf29 100644 --- a/libluna/src/Sort.cpp +++ b/libluna/src/Sort.cpp @@ -50,5 +50,6 @@ static void quicksort_impl(void* base, usize start, usize end, usize size, compa void c_quicksort(void* base, usize nmemb, usize size, compar_t compar) { + if (nmemb == 0) return; quicksort_impl(base, 0, nmemb - 1, size, compar); }