-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_strprefix.c
21 lines (20 loc) · 1.04 KB
/
ft_strprefix.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strprefix.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlambert <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/04/01 23:19:28 by rlambert #+# #+# */
/* Updated: 2015/04/01 23:19:28 by rlambert ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strprefix(const char *str, const char *prefix)
{
while (*prefix != '\0' && *str != '\0' && *str == *prefix)
{
prefix++;
str++;
}
return (*prefix == '\0');
}