fxlibc/src/libc/string/strchr.c

11 lines
148 B
C
Raw Normal View History

2021-05-09 17:34:00 +02:00
#include <string.h>
2020-09-17 19:27:01 +02:00
char *strchr(char const *s, int c)
2020-09-17 19:27:01 +02:00
{
for(size_t i = 0; s[i]; i++) {
if(s[i] == c) return (char *)&s[i];
2020-09-17 19:27:01 +02:00
}
return NULL;
2020-09-17 19:27:01 +02:00
}