-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_mem2join.c
30 lines (28 loc) · 1.11 KB
/
ft_mem2join.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
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_mem2join.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jraymond <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/06/25 18:46:40 by jraymond #+# #+# */
/* Updated: 2018/06/26 18:46:16 by jraymond ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_mem2join(char *dest, char *s1, char *s2, size_t size)
{
if (s1)
ft_strcpy(dest, s1);
dest += ft_strlen(dest);
if (s2)
{
while (size-- && *s2)
{
*dest = *s2;
dest++;
s2++;
}
}
*dest = '\0';
}