This commit is contained in:
Maryna Kravtsova 2020-11-03 20:48:12 +01:00
parent 52dfe1c8e7
commit c484e99e36

View File

@ -69,7 +69,7 @@ struct car* clear_train(struct car* first, const char* target) {
if(first == this){ if(first == this){
first = this->next; first = this->next;
free(this); free(this);
return 0; return first;
} }
while(curr != this){ while(curr != this){
prev = curr; prev = curr;
@ -77,7 +77,7 @@ struct car* clear_train(struct car* first, const char* target) {
} }
prev->next = curr->next; prev->next = curr->next;
//free(this); free(this);
} }
this = this->next; this = this->next;
} }