-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strdup.c
More file actions
23 lines (20 loc) · 1.06 KB
/
ft_strdup.c
File metadata and controls
23 lines (20 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strdup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mschumac <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/05/16 14:07:26 by mschumac #+# #+# */
/* Updated: 2017/05/16 14:39:32 by mschumac ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strdup(const char *s1)
{
char *new_string;
new_string = (char*)malloc(ft_strlen(s1) + 1);
if (!new_string)
return (NULL);
return (ft_strcpy(new_string, s1));
}