This commit is contained in:
Maryna Kravtsova 2020-11-03 22:16:01 +01:00
parent 8479b9ba53
commit 1fc8770eab

View File

@ -88,7 +88,7 @@ struct car* clear_train(struct car* first, const char* target) {
if(first == this){
first = this->next;
free(this);
first->next = NULL;
//first->next = NULL;
return first;
}
while(curr != this){
@ -97,6 +97,7 @@ struct car* clear_train(struct car* first, const char* target) {
}
prev->next = curr->next;
first->next = NULL:
free(this);
}
this = this->next;