-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlcpy.c
29 lines (26 loc) · 1.14 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: sbin-jef <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/28 15:19:11 by sbin-jef #+# #+# */
/* Updated: 2024/08/12 04:31:04 by sbin-jef ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
unsigned int ft_strlcpy(char *dt, const char *src, unsigned int size)
{
unsigned int i;
if (size == 0)
return (ft_strlen(src));
i = 0;
while (i < size - 1 && src[i] != '\0')
{
dt[i] = src[i];
i++;
}
dt[i] = '\0';
return (ft_strlen(src));
}