From daede0fcae63ca3e86fe4929f46c67de2b672417 Mon Sep 17 00:00:00 2001 From: hugodu69 Date: Mon, 2 Dec 2019 01:39:04 +0100 Subject: [PATCH] ajout explication strlcpy --- srcs/part1/ft_strlcpy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/srcs/part1/ft_strlcpy.c b/srcs/part1/ft_strlcpy.c index 5971964..48ef5b8 100644 --- a/srcs/part1/ft_strlcpy.c +++ b/srcs/part1/ft_strlcpy.c @@ -14,6 +14,10 @@ ** copy size - 1 length of src into dest, ** terminate it with a '\0' ** and return size of src +** this way, if you try to copy a name in a variable with an available size +** of 5 for exemple, if you use ft_strlcpy(variable, name, sizeof(variable)) +** you will know if the name was too long for the variable by looking at the +** return value (which is size of name) */ /*