blob: 65a6ac6ec2fd0743cd4a0f025027009c685ca961 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strdup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:18:07 by cacharle #+# #+# */
/* Updated: 2019/11/20 03:13:47 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strdup(const char *s)
{
char *clone;
if ((clone = ft_strnew(ft_strlen(s))) == NULL)
return (NULL);
return (ft_strcpy(clone, s));
}
|