-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strsub.c
22 lines (19 loc) · 1.07 KB
/
ft_strsub.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsub.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bpezeshk <bpezeshk@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/17 14:12:00 by bpezeshk #+# #+# */
/* Updated: 2017/01/19 13:12:56 by bpezeshk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strsub(char const *s, unsigned int start, size_t len)
{
char *ss;
if (!s || (ss = ft_strnew(len)) == NULL)
return (NULL);
return (ft_strntilcpy(ss, s + start, len));
}