scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 3a48fd7f02df7f7d660beb7b4227c07cc7bf6c89
parent 1df0c79117b0f38557f5471580c133d987e3af00
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon, 26 Feb 2018 13:47:50 +0100

libc: bsearch(), fix cmp check

Diffstat:
Mlib/c/bsearch.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/c/bsearch.c b/lib/c/bsearch.c @@ -15,7 +15,7 @@ bsearch(const void *key, const void *ary, size_t n, size_t size, mid = low + (high - low) / 2; cur = base + mid*size; - if ((t == (*cmp)(key, cur)) == 0) + if ((t = (*cmp)(key, cur)) == 0) return (void *) cur; else if (t > 0) low = mid + 1;