diff --git a/cv4/a_train.c b/cv4/a_train.c index 5d61b3f..06f53de 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -61,5 +61,12 @@ struct car* clear_train(struct car* first, const char* target) { this = this->next; } } - return first; + if(strcmp(this->value, target) ==0){ + free(this); + this->next = NULL; + return this; + } + else{ + return first; + } }