-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_bi_rep.c
33 lines (30 loc) · 1.17 KB
/
ft_bi_rep.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bi_rep.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/26 19:29:41 by ohachim #+# #+# */
/* Updated: 2019/05/26 05:40:46 by ohachim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_bi_rep(unsigned char *fl, int i)
{
char *box;
char *temp;
char *to_bi;
box = ft_strnew(1);
temp = box;
while (i >= 0)
{
to_bi = ft_to_bi(fl[i]);
box = ft_strjoin(box, ft_normalize(&to_bi));
free(temp);
temp = box;
free(to_bi);
i--;
}
return (box);
}