GCC Code Coverage Report


Directory: ./
File: lib/mylist/my_params_to_list.c
Date: 2024-06-05 02:24:39
Exec Total Coverage
Lines: 0 9 0.0%
Functions: 0 1 0.0%
Branches: 0 2 0.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_params_to_list
4 ** File description:
5 ** Creates a linked list from the arguments (argc and argv)
6 */
7
8 #include "mylist.h"
9
10 linked_list_t *my_params_to_list(int ac, char *const *av)
11 {
12 linked_list_t *list = malloc(sizeof(linked_list_t));
13
14 list->prev = NULL;
15 list->data = my_strdup(av[0]);
16 list->type = STRING;
17 list->next = NULL;
18 for (int arg = 1; arg < ac; arg++)
19 my_push_front(&list, my_strdup(av[arg]), STRING);
20 return list;
21 }
22