clear
This commit is contained in:
parent
8479b9ba53
commit
1fc8770eab
@ -88,7 +88,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);
|
||||||
first->next = NULL;
|
//first->next = NULL;
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
while(curr != this){
|
while(curr != this){
|
||||||
@ -97,6 +97,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
prev->next = curr->next;
|
prev->next = curr->next;
|
||||||
|
first->next = NULL:
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
this = this->next;
|
this = this->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user