Files
photon/libc/string/strchr.c

15 lines
216 B
C
Raw Normal View History

2022-05-10 20:50:43 +01:00
#include <string.h>
char *strchr(const char *str, int ch)
{
char c = ch;
for (size_t i = 0; str[i]; i++) {
if (str[i] == c) {
return (char *)&str[i];
}
}
return NULL;
}