diff --git a/cv4/a_train.c b/cv4/a_train.c index 5122cd4..0a31175 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -57,6 +57,10 @@ struct car* clear_train(struct car* first, const char* target) { this->next=NULL; free(this->next); return this; + }else if(strcmp(this->next->value, target) == 0){ + free(this->next); + this->next=NULL; + return this; } } while( this->next->next != NULL){