lib: c: core: implement strchr and strcspn
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include <stddef.h>
|
||||
|
||||
char *strchr(const char *str, int c)
|
||||
{
|
||||
while (1) {
|
||||
if (*str == c) {
|
||||
return (char *)str;
|
||||
}
|
||||
|
||||
if (*str == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user