]> Dogcows Code - chaz/openbox/blobdiff - obt/bsearch.h
oops, crash if searching for something smaller than * in the array
[chaz/openbox] / obt / bsearch.h
index 65e426806f898fff58222d8cea30e9364cb0079e..9613c51b36dda4f86cddabfc19bec7a4033cc9a6 100644 (file)
@@ -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 */ \
     } \
This page took 0.023704 seconds and 4 git commands to generate.