ft_strappend

This commit is contained in:
Jack Halford 2016-12-13 12:58:51 +01:00
parent 66e8156235
commit 7fd7d8c23c
4 changed files with 26 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
/* Updated: 2016/12/10 17:02:46 by jhalford ### ########.fr */
/* Updated: 2016/12/13 12:18:54 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -126,6 +126,7 @@ char *ft_convert_base(
char *str, char *base_from, char *base_to, char *flags);
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_itoa_base(int nbr, char *base, char *flags);
char *ft_lltoa_base(long long nbr, char *base, char *flags);

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:33:27 by jhalford #+# #+# */
/* Updated: 2016/12/12 11:57:28 by jhalford ### ########.fr */
/* Updated: 2016/12/13 11:20:36 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:33:32 by jhalford #+# #+# */
/* Updated: 2016/12/10 16:51:11 by jhalford ### ########.fr */
/* Updated: 2016/12/13 11:19:29 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strappend.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/13 12:16:31 by jhalford #+# #+# */
/* Updated: 2016/12/13 12:18:41 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strappend(char **dst, char *src)
{
char *out;
if (!(out = ft_strjoin(*dst, src)))
return (-1);
ft_strdel(*dst);
*dst = out;
return (0);
}