diff --git a/cv4/a_train.c b/cv4/a_train.c index 5ed5772..175ce96 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -55,10 +55,10 @@ struct car* clear_train(struct car* first, const char* target) { if(strcmp(this->value, target) == 0){ //strcpy(this->value,this->next->value); //this->next=NULL; + strucat car* tmp = this->next; free(this); - this=this->next; //free(this->next); - return this; + return tmp; }else if(strcmp(this->next->value, target) == 0){ free(this->next); this->next=NULL;