From 560f81327636e6f3bb00a9c5906bf18bb8a40bfb Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:52:07 +0100 Subject: [PATCH] final2? --- cv4/a_train.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cv4/a_train.c b/cv4/a_train.c index 5122cd4..0a31175 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -57,6 +57,10 @@ struct car* clear_train(struct car* first, const char* target) { this->next=NULL; free(this->next); return this; + }else if(strcmp(this->next->value, target) == 0){ + free(this->next); + this->next=NULL; + return this; } } while( this->next->next != NULL){