clear
This commit is contained in:
parent
7110825154
commit
466f69ab17
@ -77,20 +77,14 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
prev = curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
prev->next = curr->next;
|
||||
curr->next = prev->next;
|
||||
this->next = NULL;
|
||||
free(this);
|
||||
|
||||
}
|
||||
this = this->next;
|
||||
}
|
||||
|
||||
|
||||
int x = strcmp(this->value, target);
|
||||
if(x == 0){
|
||||
free(this->next);
|
||||
this->next = NULL;
|
||||
return first;
|
||||
}
|
||||
return first;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user