-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathft_strsubchr.c
22 lines (19 loc) · 1.03 KB
/
ft_strsubchr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsubchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazhni <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/07/26 14:05:08 by vbrazhni #+# #+# */
/* Updated: 2018/07/26 14:05:09 by vbrazhni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strsubchr(const char *s, char c)
{
char *ptr;
if (!(ptr = ft_strchrs(s, c)))
return (NULL);
return (ft_strsub(s, 0, ptr - s));
}