all repos — openbox @ 7eeae03f0668cbdfe461d126e076dd97a98b6b05

openbox fork - make it a bit more like ryudo

oops, crash if searching for something smaller than * in the array
Dana Jansens danakj@orodu.net
commit

7eeae03f0668cbdfe461d126e076dd97a98b6b05

parent

d3660704f1195fb724f5c0c027bdd084824c511f

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M obt/bsearch.hobt/bsearch.h

@@ -40,8 +40,9 @@ out_BSEARCH = l_BSEARCH + (r_BSEARCH - l_BSEARCH)/2; \

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 */ \ } \