aboutsummaryrefslogtreecommitdiff
path: root/ft_strchr.c
blob: 67b969ef375915247f37b03b49fae4a013493eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>

char    *ft_strchr(const char *s, int c)
{
    char   *cursor;

    cursor = (char*)s;
    while (*cursor)
    {
        if (*cursor == (char)c)
            return (cursor);
        cursor++;
    }
    if (c == 0)
        return (cursor);
    return (NULL);
}