Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2023 |
3 |
|
|
** my_concat_list |
4 |
|
|
** File description: |
5 |
|
|
** Concatenates two linked lists |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#include "mylist.h" |
9 |
|
|
|
10 |
|
✗ |
void my_concat_list(linked_list_t **begin1, linked_list_t *begin2) |
11 |
|
|
{ |
12 |
|
✗ |
linked_list_t *tmp = *begin1; |
13 |
|
|
|
14 |
|
✗ |
if (*begin1 == NULL) { |
15 |
|
✗ |
*begin1 = begin2; |
16 |
|
✗ |
return; |
17 |
|
|
} |
18 |
|
✗ |
for (; tmp->next != NULL; tmp = tmp->next); |
19 |
|
✗ |
tmp->next = begin2; |
20 |
|
✗ |
begin2->prev = tmp; |
21 |
|
|
} |
22 |
|
|
|