libft/str/ft_strcpy.c
Raphael 905ffd4b72
refactor: only the usefull header
- Removing all 'libft.h' mention
- Using the include only on the files needed by
2025-09-01 18:45:33 +02:00

35 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/31 16:14:10 by rparodi #+# #+# */
/* Updated: 2025/09/01 17:36:18 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
/**
* @brief Copies a string.
*
* @param dst The destination buffer.
* @param src The source string.
*
* @return A pointer to `dst`.
*/
char *ft_strcpy(char *dst, const char *src)
{
size_t i;
i = 0;
while (src[i])
{
dst[i] = src[i];
i++;
}
dst[i] = '\0';
return (dst);
}