-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlcpy.c
More file actions
27 lines (24 loc) · 1.11 KB
/
Copy pathft_strlcpy.c
File metadata and controls
27 lines (24 loc) · 1.11 KB
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_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mtortrot <mtortrot@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/06 19:16:33 by mtortrot #+# #+# */
/* Updated: 2022/09/06 19:16:35 by mtortrot ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcpy(char *dest, const char *src, size_t size)
{
size_t i;
size_t len;
i = -1;
len = ft_strlen(src);
if (size)
while (++i < (size - 1) && len && src[i])
dest[i] = src[i];
dest[i] = '\0';
return (len);
}