aboutsummaryrefslogtreecommitdiff
path: root/lib/libft/ft_strncpy.c
diff options
context:
space:
mode:
authorcuhlig2024-10-17 14:34:33 +0200
committerGitHub2024-10-17 14:34:33 +0200
commit92bdbf67adaf09d1c831db3cee9456e9c447063f (patch)
treea6478101a4cb0e2fb6b7b0d2a3e1b1bef1c0a4b7 /lib/libft/ft_strncpy.c
parenta0016dffa6c5412d7c53b3d9040b837299c50159 (diff)
parent85d82207526e7220bd14bc96e5f8079ec781fc75 (diff)
downloadminishell-92bdbf67adaf09d1c831db3cee9456e9c447063f.tar.gz
minishell-92bdbf67adaf09d1c831db3cee9456e9c447063f.zip
Merge branch 'main' into env
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);
+}