libc: fix wrong argument order to bsearch comparator
This commit is contained in:
parent
204d80496d
commit
5e9efbac4b
@ -7,7 +7,7 @@ void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
|
|||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
while (i < nmemb) {
|
while (i < nmemb) {
|
||||||
const void * a = b;
|
const void * a = b;
|
||||||
if (!compar(a,key)) return (void *)a;
|
if (!compar(key,a)) return (void *)a;
|
||||||
i++;
|
i++;
|
||||||
b += size;
|
b += size;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user