From ccab18086059aaf73a4498951dca3f1d37966cb4 Mon Sep 17 00:00:00 2001 From: vj586da Date: Fri, 5 Nov 2021 08:44:18 +0100 Subject: [PATCH] test --- cv4/a_train.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 13f0b6b..f4d7ef3 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -52,7 +52,12 @@ struct car* clear_train(struct car* first, const char* target) { } } while( this->next->next != NULL){ - if(strcmp(this->next->value, target) == 0){ + if(strcmp(this->value, target) == 0){ + struct car* tmp = this->next; + free(this); + return tmp; + } + else if(strcmp(this->next->value, target) == 0){ struct car* third = this->next->next; free(this->next); this->next = third;