attractivechaos/klib

heapsort crash if input is empty

jpcima opened this issue · 0 comments

Given 0 as lsize, the program crashes.
These are the relevant lines.

klib/ksort.h

Lines 144 to 145 in 9a063b3

size_t i; \
for (i = lsize - 1; i > 0; --i) { \