[Cryptech-Commits] [sw/libhal] 07/08: Fencepost error in ks_heapsort().
    git at cryptech.is 
    git at cryptech.is
       
    Sun Oct 16 20:23:47 UTC 2016
    
    
  
This is an automated email from the git hooks/post-receive script.
sra at hactrn.net pushed a commit to branch ksng
in repository sw/libhal.
commit 534f465c5934c53c8f330e5f6227cc918151169f
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sat Oct 15 15:21:01 2016 -0400
    Fencepost error in ks_heapsort().
---
 ks_index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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);
   }
 }
 
    
    
More information about the Commits
mailing list