clear train
This commit is contained in:
parent
7d8b479f1c
commit
a4e02b775f
@ -40,6 +40,9 @@ void cancel_train(struct car* first) {
|
|||||||
|
|
||||||
struct car* clear_train(struct car* first, const char* target) {
|
struct car* clear_train(struct car* first, const char* target) {
|
||||||
struct car* this = first;
|
struct car* this = first;
|
||||||
|
if (this == NULL){
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
while( this->next->next != NULL){
|
while( this->next->next != NULL){
|
||||||
if(strcmp(this->value, target) == 0){
|
if(strcmp(this->value, target) == 0){
|
||||||
this->next == this->next->next;
|
this->next == this->next->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user