-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strncat.c
31 lines (28 loc) · 1.18 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
28
29
30
31
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strncat.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: thperchi <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/07/08 02:06:11 by thperchi #+# ## ## #+# */
/* Updated: 2018/10/10 18:46:29 by thperchi ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *dest, const char *src, size_t nb)
{
size_t x;
size_t y;
x = 0;
y = ft_strlen(dest);
while (src[x] && x < nb)
{
dest[y] = src[x];
x++;
y++;
}
dest[y] = '\0';
return (dest);
}