correction
Tests Basics avec Criterion / test (push) Successful in 5s

This commit is contained in:
2026-04-02 15:52:42 +02:00
parent 7b93a83737
commit f5c181b822
3 changed files with 121 additions and 4 deletions
@@ -2,6 +2,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct list *list_append(struct list *l, int e)
{
struct list *tmp = l;
@@ -30,7 +31,7 @@ size_t list_count(struct list *l){
tmp = tmp->next;
}
return nbr_nodes;
return nbr_nodes + 1;
}
@@ -161,7 +162,7 @@ void list_print(struct list *l){
}
printf("\n");
}
/*
int main(void)
{
struct list *l = NULL;
@@ -174,10 +175,13 @@ int main(void)
// l = [1] -> [2] -> [3]
list_insert(&l, 1, 99); // l = [1] -> [99] -> [2] -> [3], and list_insert returns 0
list_insert(&l, 9, 99); // list unchanged, returns 1
list_print(l);
list_count(NULL); // 0
printf("count : %li\n",list_count(l)); // 3
list_destroy(l);
return 0;
}
*/
Binary file not shown.