| 123456789101112131415161718192021222324252627 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strjoin.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2015/11/26 20:09:15 by bchanot #+# #+# */
- /* Updated: 2016/10/16 22:13:42 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- #include <stdlib.h>
- char *ft_strjoin(char const *s1, char const *s2)
- {
- char *str;
- if (!s1 || !s2)
- return (NULL);
- if (!(str = ft_strnew(ft_strlen(s1) + ft_strlen(s2))))
- return (NULL);
- str = ft_strcpy(str, (char *)s1);
- str = ft_strcat(str, (char *)s2);
- return (str);
- }
|