shithub: scc

Download patch

ref: bb3a3db29db8b3c84e54aa820fe3f37b2b979794
parent: 0b5b425ee75e1287e853ee243d76432323e28047
author: Hiltjo Posthuma <hiltjo@codemadness.org>
date: Mon Feb 26 08:47:50 EST 2018

libc: bsearch(), fix cmp check

--- a/lib/c/bsearch.c
+++ b/lib/c/bsearch.c
@@ -15,7 +15,7 @@
 		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;