oops, crash if searching for something smaller than * in the array
This commit is contained in:
parent
d3660704f1
commit
7eeae03f06
1 changed files with 2 additions and 1 deletions
|
@ -40,8 +40,9 @@ G_BEGIN_DECLS
|
||||||
if ((val) == (ar)[out_BSEARCH]) { \
|
if ((val) == (ar)[out_BSEARCH]) { \
|
||||||
break; \
|
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 */ \
|
r_BSEARCH = out_BSEARCH-1; /* search to the left side */ \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
l_BSEARCH = out_BSEARCH+1; /* search to the left side */ \
|
l_BSEARCH = out_BSEARCH+1; /* search to the left side */ \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in a new issue