clear train
This commit is contained in:
parent
231059682f
commit
56ae5df2a6
@ -54,12 +54,12 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
while( this->next->next != NULL){
|
while( this->next->next != NULL){
|
||||||
if(strcmp(this->next->value, target) == 0){
|
if(strcmp(this->next->value, target) == 0){
|
||||||
free(this->next);
|
free(this->next);
|
||||||
this == this->next->next;
|
this->next = this->next->next;
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
continue;
|
this = this->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return first;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user