ft_strbetween duplicates string in between 2 addresses
This commit is contained in:
parent
2e1f96a78b
commit
f7b9265c1c
7 changed files with 29 additions and 6 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/15 15:21:08 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 16:28:39 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -128,6 +128,7 @@ char *ft_convert_base(
|
|||
char *ft_strcatf(char *s1, const char *s2);
|
||||
char *ft_strinsert(char *str, char c, int n);
|
||||
int ft_strappend(char **dst, char *src);
|
||||
char *ft_strbetween(char *start, char *end);
|
||||
|
||||
char *ft_itoa_base(int nbr, char *base, char *flags);
|
||||
char *ft_lltoa_base(long long nbr, char *base, char *flags);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/04 11:09:12 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/15 17:58:29 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 16:26:31 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/14 15:59:10 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/14 15:59:39 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 16:28:40 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/07 14:25:45 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/09 19:14:52 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 17:49:34 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/05 11:53:36 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/05 16:38:33 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 14:42:45 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
22
libft/src/str/ft_strbetween.c
Normal file
22
libft/src/str/ft_strbetween.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strbetween.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/01/11 16:26:44 by jhalford #+# #+# */
|
||||
/* Updated: 2017/01/11 16:38:13 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strbetween(char *start, char *end)
|
||||
{
|
||||
char *out;
|
||||
|
||||
out = ft_strnew(end - start + 1);
|
||||
ft_strncpy(out, start, end - start);
|
||||
return (out);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:58:34 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/03 14:58:35 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/11 16:37:53 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue