title: bsearch return NULL but the element is in the array
body: <pre><code>#define u32 uint32_t
  #define Narray 10
  
  struct edge {
    u32 v1;
    u32 v2;
  };
  int struct_cmp_by_v1(const void *i, const void *j) {
    struct edge *a = (struct edge *)i;
    struct edge *b = (struct edge *)j;
    u32 x = a-&gt;v1;
    u32 y = b-&gt;v1;
    return x &gt; y ? 1 : -1;
  }
  struct edge *array = malloc((sizeof(struct edge))*Narray);
  struct edge *l = malloc(sizeof(struct edge));
  struct edge *e = (struct edge *) bsearch(l, array, Narray, sizeof(struct edge), struct_cmp_by_v1);
  </code></pre>
  
  <p>The array is small with large numbers u32 but I only look for an element according to a field of the ,struct edge, that is v1 then the comparison is only made between v1.</p>
  
  <p>The key used by bsearch is, struct edge *l, where l->v1 contains the element to be searched.</p>
  
  <p>The ,array of struct edge, has element v1 to find but bserach does not find it and return NULL, I do not see the error that I'm committing</p>
  
  <p>Note: The array contains only 10 elements to test but it can be a very large array with 25056012 elements, even more</p>