-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcpyc.c
29 lines (26 loc) · 1.11 KB
/
ft_strcpyc.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
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpyc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/29 19:58:12 by ohachim #+# #+# */
/* Updated: 2018/10/29 20:01:38 by ohachim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcpyc(char *dst, const char *src, char c)
{
int cn;
if (ft_strlen(src) == 0)
return (NULL);
cn = 0;
while (src[cn] != c && src[cn] != '\0')
{
dst[cn] = src[cn];
cn++;
}
dst[cn] = '\0';
return (dst);
}