| 12345678910111213141516171819202122232425 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strdup.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/11/23 14:55:16 by bchanot #+# #+# */
- /* Updated: 2018/10/13 21:20:06 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- char *ft_strdup(const char *src)
- {
- char *s;
- if (!src)
- return (NULL);
- if (!(s = ft_strnew(ft_strlen(src))))
- return (NULL);
- ft_strcpy(s, src);
- return (s);
- }
|