This commit is contained in:
Maryna Kravtsova 2020-11-04 23:17:32 +01:00
parent 1239c83a7f
commit c973646eae

View File

@ -73,17 +73,14 @@ struct car* clear_train(struct car* first, const char* target) {
free(this);
return first;
}
else{
else if(this->next->next == NULL){
while(tmp->next != NULL){
prev = tmp;
tmp = tmp->next;
}
free(tmp);
prev->next = NULL;
}
}
}
this = this->next;
}