bl_mcu_sdk/common/libc/src/strchr.c
2021-06-20 12:25:46 +08:00

24 lines
315 B
C

/*
* Derived from:
* http://www.kernel.org/pub/linux/libs/klibc/
*/
/*
* strchr.c
*/
#include <string.h>
#include <compat_attribute.h>
__WEAK__
char *strchr(const char *s, int c)
{
while (*s != (char)c) {
if (!*s) {
return NULL;
}
s++;
}
return (char *)s;
}