aboutsummaryrefslogtreecommitdiff
path: root/lib/libft/ft_strncpy.c
diff options
context:
space:
mode:
authorcuhlig2024-08-09 16:26:37 +0200
committerGitHub2024-08-09 16:26:37 +0200
commit8abf7abdc9d49f52c4fcad0afc92730c4c195b7f (patch)
tree2255b668d61572fac185c3d6b5ddf7830a675371 /lib/libft/ft_strncpy.c
parent36d2b4da2887419705cd22eb97a6283be86816f4 (diff)
parente197ecae60b005b0cfe7270f243740ae967bcb7d (diff)
downloadminishell-8abf7abdc9d49f52c4fcad0afc92730c4c195b7f.tar.gz
minishell-8abf7abdc9d49f52c4fcad0afc92730c4c195b7f.zip
Merge pull request #12 from dpu-kaiser/tokenizer
Tokenizer
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);
+}