From 7aaca319e2036873cf632481a268f68543b7381d Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:49:57 +0100 Subject: [PATCH] final? --- cv4/a_train.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 8880447..5122cd4 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -53,8 +53,9 @@ struct car* clear_train(struct car* first, const char* target) { } if(this->next->next == NULL){ if(strcmp(this->value, target) == 0){ - free(this); + strcpy(this->value,this->next->value); this->next=NULL; + free(this->next); return this; } }