Compare commits

...

2 Commits

Author SHA1 Message Date
d9c0ad3b48 correct cv4 2024-10-17 23:03:17 +02:00
81eac89d18 correct cv4 2024-10-17 23:02:31 +02:00

View File

@ -76,6 +76,27 @@ struct car* clear_train(struct car* first, const char* target)
}
}
struct car* prev = first;
if(prev->next->next == NULL)
{
if(!strcmp(prev->value, target))
{
struct car* second = prev->next;
free(prev);
first = second;
return first;
}
else if(!strcmp(prev->next->value, target))
{
free(prev->next);
return first;
}
else
{
return first;
}
}
while (prev->next->next != NULL)
{
if(strcmp(prev->value, target))