This commit is contained in:
Bohdan Kapliuk 2024-03-13 18:44:05 +02:00
commit 115d308b5f
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ list_t *new_list(size_t length, list_element_t elements[]){
list_t* list = (list_t*)malloc(sizeof(list_t) + length * sizeof(list_element_t)); list_t* list = (list_t*)malloc(sizeof(list_t) + length * sizeof(list_element_t));
list->length = length; list->length = length;
memcpy(list->elements,elements, length*sizeof(list_element_t)); memcpy(list->elements,elements, length*sizeof(list_element_t));
<<<<<<< HEAD
free(list); free(list);
return list; return list;
} }

View File

@ -1,6 +1,7 @@
#ifndef LIST_OPS_H #ifndef LIST_OPS_H
#define LIST_OPS_H #define LIST_OPS_H
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>