From 26f425b8111e0b4d16a1100362842f91f82ae446 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 11 Mar 2024 01:36:50 +0100 Subject: [PATCH] fix for halved output data - set list head's prev to new tail --- lab01/zad3/src/doubly_linked_list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lab01/zad3/src/doubly_linked_list.c b/lab01/zad3/src/doubly_linked_list.c index cba6614..9732c53 100644 --- a/lab01/zad3/src/doubly_linked_list.c +++ b/lab01/zad3/src/doubly_linked_list.c @@ -38,6 +38,8 @@ void doubly_linked_list_insert(DoublyLinkedList *l, void *value) { tail->next = node_new(value, l->element_size); tail->next->next = l->head; tail->next->prev = tail; + + l->head->prev = tail->next; l->length += 1; }