summaryrefslogtreecommitdiff
path: root/obt
diff options
context:
space:
mode:
Diffstat (limited to 'obt')
-rw-r--r--obt/bsearch.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/obt/bsearch.h b/obt/bsearch.h
index 65e42680..9613c51b 100644
--- a/obt/bsearch.h
+++ b/obt/bsearch.h
@@ -40,8 +40,9 @@ G_BEGIN_DECLS
if ((val) == (ar)[out_BSEARCH]) { \
break; \
} \
- else if ((val) < (ar)[out_BSEARCH]) \
+ else if ((val) < (ar)[out_BSEARCH] && out_BSEARCH > 0) { \
r_BSEARCH = out_BSEARCH-1; /* search to the left side */ \
+ } \
else \
l_BSEARCH = out_BSEARCH+1; /* search to the left side */ \
} \