| 123456789101112131415161718192021222324252627 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_charjoin.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2016/07/23 03:06:18 by bchanot #+# #+# */
- /* Updated: 2018/10/13 19:51:19 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- #include <stdlib.h>
- char *ft_charjoin(const char *src, const char c)
- {
- char *s;
- if (!src || !c)
- return (NULL);
- if (!(s = ft_strnew(ft_strlen(src) + 1)))
- return (NULL);
- s = ft_strcpy(s, src);
- *(s + ft_strlen(s)) = c;
- return (s);
- }
|