ft_strdup.c 1.0 KB

123456789101112131415161718192021222324
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_strdup.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/08 17:49:42 by mazimi #+# #+# */
  9. /* Updated: 2014/12/26 12:58:54 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. char *ft_strdup(const char *s1)
  14. {
  15. char *s;
  16. char *sc;
  17. s = (char *)s1;
  18. sc = ft_strnew(ft_strlen(s));
  19. ft_strcpy(sc, (char *)s1);
  20. return (sc);
  21. }