From 534f465c5934c53c8f330e5f6227cc918151169f Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 15 Oct 2016 15:21:01 -0400 Subject: Fencepost error in ks_heapsort(). --- ks_index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ks_index.c') diff --git a/ks_index.c b/ks_index.c index edfc7fa..40238db 100644 --- a/ks_index.c +++ b/ks_index.c @@ -141,7 +141,7 @@ static inline void ks_heapsort(hal_ks_index_t *ksi) const uint16_t tmp = ksi->index[i]; ksi->index[i] = ksi->index[0]; ksi->index[0] = tmp; - ks_heapsift(ksi, 0, i); + ks_heapsift(ksi, 0, i - 1); } } -- cgit v1.2.3