-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlcpy.c
29 lines (26 loc) · 1.12 KB
/
ft_strlcpy.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_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thakala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/29 22:07:04 by thakala #+# #+# */
/* Updated: 2021/11/29 23:37:01 by thakala ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
size_t ft_strlcpy(char *dst, const char *src, size_t dstsize)
{
size_t l_src;
l_src = 0;
if (dstsize)
{
while (--dstsize && src[l_src])
*dst++ = src[l_src++];
*dst = '\0';
}
while (src[l_src])
l_src++;
return (l_src);
}