ft_strcpy.c 1.1 KB

1234567891011121314151617181920212223242526
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_strcpy.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/04 16:28:55 by mazimi #+# #+# */
  9. /* Updated: 2014/12/02 16:00:26 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. char *ft_strcpy(char *dest, const char *src)
  14. {
  15. int i;
  16. i = -1;
  17. if (dest == NULL)
  18. return (NULL);
  19. while (src[++i])
  20. dest[i] = src[i];
  21. dest[i] = '\0';
  22. return (dest);
  23. }