Fri Dec 19 23:35:04 2003 Ben Pfaff <blp@gnu.org>
authorBen Pfaff <blp@gnu.org>
Sat, 20 Dec 2003 07:40:44 +0000 (07:40 +0000)
committerBen Pfaff <blp@gnu.org>
Sat, 20 Dec 2003 07:40:44 +0000 (07:40 +0000)
* algorithm.c (binary_search): Fix comparison.

src/ChangeLog
src/algorithm.c

index e72f20aee10eb5b6d1ca2be08b5566613a58fc85..63c2cc61fef16edaa74f42278a83feabe41c186c 100644 (file)
@@ -1,3 +1,7 @@
+Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
+
+       * algorithm.c (binary_search): Fix comparison.
+
 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
 
        * algorithm.c: (binary_search) Fix assertion.
index 66be93d6b01a0c673ccec491164e53233df6cdb7..ba4413da749f743070a0cddd21a16af32d6fcf3e 100644 (file)
@@ -346,7 +346,7 @@ binary_search (const void *array, size_t count, size_t size,
       int low = 0;
       int high = count - 1;
 
-      while (low < high) 
+      while (low <= high) 
         {
           int middle = (low + high) / 2;
           const unsigned char *element = first + middle * size;