raccourcis de fillsolution

This commit is contained in:
hugogogo
2021-06-27 12:26:18 +02:00
parent 337c28227d
commit c38f2383f7
7 changed files with 7 additions and 30 deletions

View File

@@ -17,18 +17,13 @@
*/
void fill_solution(t_list *solution, char *sp)
{
t_stack **tmp1;
t_stack **tmp2;
t_stack *a;
t_stack *b;
char *stack;
tmp1 = solution->content;
tmp2 = solution->next->content;
a = *tmp1;
b = *tmp2;
stack = ft_strdup(sp);
stack = ft_strjoinfree(stack, ft_strdup("!a:"));
a = *(t_stack **)(solution->content);
b = *(t_stack **)(solution->next->content);
stack = ft_strjoinfree(ft_strdup(sp), ft_strdup("!a:"));
while(a != NULL)
{
stack = ft_strjoinfree(stack, ft_strdup(" "));
@@ -36,7 +31,7 @@ void fill_solution(t_list *solution, char *sp)
a = a->next;
}
stack = ft_strjoinfree(stack, ft_strdup("!b:"));
while(b)
while(b != NULL)
{
stack = ft_strjoinfree(stack, ft_strdup(" "));
stack = ft_strjoinfree(stack, ft_itoa(b->n));