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