Commiting

This commit is contained in:
Anton Dolozin 2025-10-28 18:17:42 +01:00
parent a7b831eab5
commit 377ae74ccc

View File

@ -54,6 +54,11 @@ struct car* clear_train(struct car* first, const char* target) {
return first;
}
if(first->next->next == NULL && strcmp(first->value, target) == 0){
struct car* temp = first;
first = first->next;
first->next = NULL;
free(temp);
return NULL;
}
struct car* temp = first;
@ -72,6 +77,6 @@ struct car* clear_train(struct car* first, const char* target) {
}
return temp;
return first;
}