aboutsummaryrefslogtreecommitdiff
path: root/lib/libft/ft_strncpy.c
blob: 9d772cb73de15ec6fd7b1b119fed4af37f5bf98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_strncpy.c                                       :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2024/08/05 13:41:47 by chuhlig           #+#    #+#             */
/*   Updated: 2024/08/05 14:22:26 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];
	// s1[i] = '\0';
	return (s1);
}