This commit is contained in:
gazhonsepaskwa
2025-02-12 11:39:05 +01:00
parent 2350222238
commit 99a74ea9ac
7 changed files with 25 additions and 14 deletions

View File

@@ -32,15 +32,15 @@ int add_node_back(t_node **head, char *val, t_token token, t_pres pres)
{
t_node *tmp;
tmp = *head;
if (!val)
return (0);
if (!head || !(*head))
{
(*head) = create_node(val, token);
*head = create_node(val, token);
(*head)->pressision = pres;
return (1);
}
tmp = *head;
while (tmp->next != NULL)
tmp = tmp->next;
tmp->next = create_node(val, token);