aboutsummaryrefslogtreecommitdiff
path: root/lib/libft/ft_strncpy.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-08-11 11:18:26 +0200
committerDominik Kaiser2024-08-11 11:18:26 +0200
commit8cf2aec82f98094d8175c5e5daaaa115f9b64fc2 (patch)
tree9c06dfc42031efc26f1fdfeec4bca8c975c4199c /lib/libft/ft_strncpy.c
parentc7a4494fd97b7e80665cbd47ed96bc37bf5800e5 (diff)
parent8abf7abdc9d49f52c4fcad0afc92730c4c195b7f (diff)
downloadminishell-8cf2aec82f98094d8175c5e5daaaa115f9b64fc2.tar.gz
minishell-8cf2aec82f98094d8175c5e5daaaa115f9b64fc2.zip
Merge changes from main into parser branch
Diffstat (limited to 'lib/libft/ft_strncpy.c')
-rw-r--r--lib/libft/ft_strncpy.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libft/ft_strncpy.c b/lib/libft/ft_strncpy.c
new file mode 100644
index 0000000..a1a2293
--- /dev/null
+++ b/lib/libft/ft_strncpy.c
@@ -0,0 +1,21 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strncpy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/08/05 13:41:47 by chuhlig #+# #+# */
+/* Updated: 2024/08/09 15:26:40 by chuhlig ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+char *ft_strncpy(char *s1, char *s2, int n)
+{
+ int i;
+
+ i = -1;
+ while (++i < n && s2[i])
+ s1[i] = s2[i];
+ return (s1);
+}