-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_addslash.c
23 lines (21 loc) · 1.09 KB
/
ft_addslash.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_addslash.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lbopp <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/09 16:12:55 by lbopp #+# #+# */
/* Updated: 2017/02/09 16:12:58 by lbopp ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_addslash(char *s1, char *s2)
{
if (!s1 || !s2)
return (NULL);
if (s1[ft_strlen(s1) - 1] && s1[ft_strlen(s1) - 1] != '/')
s1 = ft_stradd(s1, "/");
s1 = ft_stradd(s1, s2);
return (s1);
}