From: Ben Pfaff Date: Sat, 20 Dec 2003 07:40:44 +0000 (+0000) Subject: Fri Dec 19 23:35:04 2003 Ben Pfaff X-Git-Tag: v0.4.0~410 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d2ddae02038b4dfcc4e224b7d175eb7baebc15f;p=pspp-builds.git Fri Dec 19 23:35:04 2003 Ben Pfaff * algorithm.c (binary_search): Fix comparison. --- 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;