Commit 9965f91e authored by Unknown's avatar Unknown
Browse files

Auto stash before merge of "master" and "origin/master"

debug function insert_empty_list and insert_beginning_ist
parent 130bc8f1
File added
......@@ -26,7 +26,12 @@ void insert_empty_list(List* list, char* str){
}
Element* e = malloc(sizeof(Element));
strncpy(e->data, str, N);
char tmp[N];
strncpy(tmp, str, N);
e->data = tmp;
e->next = NULL;
list->head = e;
list->tail = e;
......@@ -45,9 +50,11 @@ void insert_beginning_list(List* list, char* str){
}
Element* e = malloc(sizeof(Element));
if (DEBUG) printf("Trying to put input into a new element...\n", list, str);
strncpy(e->data, str, N);
if (DEBUG) printf("Trying to put input into a new element...\n");
char tmp[N];
strncpy(tmp, str, N);
e->data = tmp;
// changes the chain to plug the new element
if (DEBUG) printf("Reorganizing the list...\n", list, str);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment