shithub: scc

Download patch

ref: dc1778213cfa24ecb191208c653fd4204efcf3e7
parent: 4100a101f53391e3063652f203272462dc8537d7
author: Quentin Rameau <[email protected]>
date: Thu Feb 16 20:08:08 EST 2017

[libc] Fix strchr

Don't forget that the terminating NULL should be checked too.

--- a/libc/src/strchr.c
+++ b/libc/src/strchr.c
@@ -7,5 +7,5 @@
 {
 	while (*s && *s != c)
 		++s;
-	return (*s) ? (char *) s : NULL;
+	return (*s == c) ? (char *)s : NULL;
 }