clear
This commit is contained in:
parent
52dfe1c8e7
commit
c484e99e36
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user