From 9d2ddae02038b4dfcc4e224b7d175eb7baebc15f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 20 Dec 2003 07:40:44 +0000 Subject: [PATCH] Fri Dec 19 23:35:04 2003 Ben Pfaff * algorithm.c (binary_search): Fix comparison. --- src/ChangeLog | 4 ++++ src/algorithm.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e72f20ae..63c2cc61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +Fri Dec 19 23:35:04 2003 Ben Pfaff + + * algorithm.c (binary_search): Fix comparison. + Fri Dec 19 23:27:45 2003 Ben Pfaff * algorithm.c: (binary_search) Fix assertion. diff --git a/src/algorithm.c b/src/algorithm.c index 66be93d6..ba4413da 100644 --- a/src/algorithm.c +++ b/src/algorithm.c @@ -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; -- 2.30.2