17 lines
173 B
C
17 lines
173 B
C
#include <stddef.h>
|
|
|
|
char *strchr(const char *str, int c)
|
|
{
|
|
while (1) {
|
|
if (*str == c) {
|
|
return (char *)str;
|
|
}
|
|
|
|
if (*str == 0) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|