diff options
| author | Christopher Uhlig | 2024-10-17 15:32:43 +0200 |
|---|---|---|
| committer | Christopher Uhlig | 2024-10-17 15:32:43 +0200 |
| commit | c1ac406e52fe273a0e14b0f079b522e58c04acd3 (patch) | |
| tree | 05d2a6c6c838ade625baf9a13e3a6ff0a3663739 /lib/libft/ft_strncpy.c | |
| parent | 9298e72de61af5311678c656c12fc177589671a7 (diff) | |
| parent | 92bdbf67adaf09d1c831db3cee9456e9c447063f (diff) | |
| download | minishell-c1ac406e52fe273a0e14b0f079b522e58c04acd3.tar.gz minishell-c1ac406e52fe273a0e14b0f079b522e58c04acd3.zip | |
Merge branch 'env' of https://github.com/dpu-kaiser/minishell into env
Diffstat (limited to 'lib/libft/ft_strncpy.c')
| -rw-r--r-- | lib/libft/ft_strncpy.c | 21 |
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); +} |
