clear
This commit is contained in:
parent
c973646eae
commit
46d03ac3ad
@ -73,13 +73,14 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
free(this);
|
||||
return first;
|
||||
}
|
||||
else if(this->next->next == NULL){
|
||||
else {
|
||||
while(tmp->next != NULL){
|
||||
prev = tmp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
free(tmp);
|
||||
prev->next = NULL;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
this = this->next;
|
||||
|
Loading…
Reference in New Issue
Block a user