libft/src/ft_lincpy.c

35 lines
1.2 KiB
C
Raw Normal View History

2023-04-15 06:46:13 +02:00
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lincpy.c :+: :+: :+: */
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2021/02/04 21:40:35 by djonker #+# #+# */
/* Updated: 2023/02/07 00:40:29 by houtworm ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
void *ft_lincpy(char *dst, const char *src)
{
char *d;
const char *s;
long unsigned int i;
i = 0;
d = dst;
s = src;
if (dst != NULL || src != NULL)
{
while (s[i] != '\0' && s[i] != '\n')
{
d[i] = s[i];
i++;
}
d[i] = '\0';
}
return (dst);
}