]> Dogcows Code - chaz/openbox/commitdiff
oops, crash if searching for something smaller than * in the array
authorDana Jansens <danakj@orodu.net>
Tue, 21 Sep 2010 00:02:16 +0000 (20:02 -0400)
committerDana Jansens <danakj@orodu.net>
Mon, 24 Jan 2011 19:19:22 +0000 (14:19 -0500)
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.020375 seconds and 4 git commands to generate.