clear
This commit is contained in:
parent
d638476ad0
commit
ce3648c65b
@ -77,9 +77,11 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
struct car* this = first;
|
struct car* this = first;
|
||||||
while(this != NULL){
|
while(this != NULL){
|
||||||
int x = strcmp(this->value, target);
|
int x = strcmp(this->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
free(this->value);
|
struct car *third = this->next->next;
|
||||||
return 0;
|
free(this->next);
|
||||||
|
this->next = third;
|
||||||
|
return first;
|
||||||
}
|
}
|
||||||
this = this->next;
|
this = this->next;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user