summaryrefslogtreecommitdiff
path: root/src/game/bg_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/bg_lib.c')
-rw-r--r--src/game/bg_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/bg_lib.c b/src/game/bg_lib.c
index 382d8abd..45ddf632 100644
--- a/src/game/bg_lib.c
+++ b/src/game/bg_lib.c
@@ -2801,13 +2801,13 @@ void *bsearch( const void *key, const void *base, size_t nmemb, size_t size,
int comp;
void *ptr;
- while( low <= high )
+ while( low < high )
{
mid = low + (high - low) / 2;
ptr = (void *)((char *)base + ( mid * size ));
comp = compar (key, ptr);
if( comp < 0 )
- high = mid - 1;
+ high = mid;
else if( comp > 0 )
low = mid + 1;
else