aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_strncpy.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-17 10:56:16 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-17 10:56:16 +0100
commitfe37597119353ce183fc404417b81bd4702f64b7 (patch)
treefaa20a8352092c062e2fd272fff2104d9f2ddb3f /src/str/ft_strncpy.c
parent2e5ca2ab6276b7b24895ade28e1533356ef523dc (diff)
downloadlibft-fe37597119353ce183fc404417b81bd4702f64b7.tar.gz
libft-fe37597119353ce183fc404417b81bd4702f64b7.tar.bz2
libft-fe37597119353ce183fc404417b81bd4702f64b7.zip
Splited include like src/, Adding feature toggle protection in header
Diffstat (limited to 'src/str/ft_strncpy.c')
-rw-r--r--src/str/ft_strncpy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/str/ft_strncpy.c b/src/str/ft_strncpy.c
index a0cfb4c..07a4927 100644
--- a/src/str/ft_strncpy.c
+++ b/src/str/ft_strncpy.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:26:59 by cacharle #+# #+# */
-/* Updated: 2019/11/21 02:49:48 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 10:40:21 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,7 +17,7 @@ char *ft_strncpy(char *dest, const char *src, size_t n)
size_t len;
len = ft_strlen(src);
- ft_memcpy(dest, src, MIN(n, len));
+ ft_memcpy(dest, src, n < len ? n : len);
if (len < n)
ft_bzero(dest + len, n - len);
return (dest);