added empty list check to remove_node_from_end

This commit is contained in:
Václav Šmejkal 2023-02-04 17:27:09 +01:00
parent 0a61d0ad57
commit 951d112a4f
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -66,6 +66,8 @@ void push_to_list_end(char *identifier)
void remove_node_from_end(void)
{
if (list_head == NULL) return; //EMPTY LIST
node_t *buffer = list_head;
if (buffer -> next == NULL) //ONLY ONE NODE