| 1234567891011121314151617181920212223242526 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strdup.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/11/23 14:55:16 by bchanot #+# #+# */
- /* Updated: 2016/05/23 14:27:24 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- char *ft_strdup(const char *s1)
- {
- char *str;
- if (!s1)
- return (NULL);
- str = ft_strnew(ft_strlen(s1));
- if (!str)
- return (NULL);
- ft_strcpy(str, s1);
- return (str);
- }
|