Cub3D/libft/str/ft_strcpy.c
2024-10-31 18:17:43 +01: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: 2024/10/31 18:14:03 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.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);
}