From 71d268bb3bc48b483a0376927fc8ff366c8ff533 Mon Sep 17 00:00:00 2001 From: vj586da Date: Fri, 5 Nov 2021 08:09:05 +0100 Subject: [PATCH] ad --- cv4/a_train.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 1680f1b..185da4e 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -53,9 +53,11 @@ struct car* clear_train(struct car* first, const char* target) { } if(this->next->next == NULL){ if(strcmp(this->value, target) == 0){ - strcpy(this->value,this->next->value); - this->next=NULL; - free(this->next); + //strcpy(this->value,this->next->value); + //this->next=NULL; + free(this); + this=this->next + //free(this->next); return this; }else if(strcmp(this->next->value, target) == 0){ free(this->next);