[Cryptech-Commits] [sw/libhal] 04/12: Fencepost error in ks_find().

git at cryptech.is git at cryptech.is
Fri Sep 16 19:53:12 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 8677e58ebc751ab47f1a14273b7ef19dfa17a293
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Fri Sep 9 20:35:52 2016 -0400

    Fencepost error in ks_find().
---
 ks_index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ks_index.c b/ks_index.c
index eb6ff10..c093a0a 100644
--- a/ks_index.c
+++ b/ks_index.c
@@ -56,7 +56,7 @@ static int ks_find(const hal_ks_index_t * const ksi,
   int hi = ksi->used;
 
   for (;;) {
-    int m = (lo + hi) / 2;
+    int m = (lo + hi) >> 1;
     if (m == lo) {
       *where = hi;
       return 0;



More information about the Commits mailing list