-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_strncat.c
27 lines (25 loc) · 1.07 KB
/
ft_strncat.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akassil <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/07/04 17:14:55 by akassil #+# #+# */
/* Updated: 2017/07/31 14:11:21 by akassil ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strncat(char *dest, char *src, int nb)
{
char *result;
result = dest;
while (*dest)
dest++;
while (*src && nb != 0)
{
*dest++ = *src++;
nb--;
}
*dest = '\0';
return (result);
}