ft_strncpy.c
This commit is contained in:
parent
8d8799c509
commit
e0eeb8dee5
|
@ -6,7 +6,7 @@
|
|||
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/19 10:25:26 by tischmid #+# #+# */
|
||||
/* Updated: 2023/03/19 10:33:04 by tischmid ### ########.fr */
|
||||
/* Updated: 2023/03/19 18:05:09 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -16,13 +16,9 @@ char *ft_strncpy(char *dest, char *src, unsigned int n)
|
|||
|
||||
i = -1;
|
||||
while (++i < n && src[i] != '\0')
|
||||
{
|
||||
dest[i] = src[i];
|
||||
}
|
||||
while (++i < n)
|
||||
{
|
||||
dest[i] = '\0';
|
||||
}
|
||||
return (dest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue