-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_skip_char.c
24 lines (22 loc) · 1.03 KB
/
ft_skip_char.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_skip_char.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: esupatae <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/23 02:44:30 by esupatae #+# #+# */
/* Updated: 2019/10/23 02:44:33 by esupatae ### ########.fr */
/* */
/* ************************************************************************** */
int ft_skip_char(char **ptr, char c)
{
char *s;
if (!ptr || !*ptr)
return (0);
s = *ptr;
while (*s == c)
s++;
*ptr = s;
return (*s != '\0' ? 1 : 0);
}