Decoupling Architectural-specific Code (#35)
[lunaix-os.git] / lunaix-os / libs / klibc / string / strchr.c
1 #include <klibc/string.h>
2 #include <lunaix/types.h>
3
4 const char* weak
5 strchr(const char* str, int character)
6 {
7     char c = (char)character;
8     while ((*str)) {
9         if (*str == c) {
10             return str;
11         }
12         str++;
13     }
14     return c == '\0' ? str : NULL;
15 }