diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-09-20 20:02:16 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2011-01-24 14:19:22 -0500 |
| commit | 7eeae03f0668cbdfe461d126e076dd97a98b6b05 (patch) | |
| tree | da75b419b3a80cc15e24709b81b2143952f4f75e /obt | |
| parent | d3660704f1195fb724f5c0c027bdd084824c511f (diff) | |
oops, crash if searching for something smaller than * in the array
Diffstat (limited to 'obt')
| -rw-r--r-- | obt/bsearch.h | 3 |
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 */ \ } \ |
