From e8dc186e9c47ee7b3fea038c7355822c3ebc54d5 Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:56:24 +0100 Subject: [PATCH] final3? --- 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 c6296f4..f5fa973 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -65,8 +65,9 @@ struct car* clear_train(struct car* first, const char* target) { } while( this->next->next != NULL){ if(strcmp(this->next->value, target) == 0){ + struct car* third = this->next->next; free(this->next); - this->next = this->next->next; + this->next = third; return this; } else {