From cd80b555fdf0868e8e1a3fc557d260cedfba2acd Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:18:56 +0100 Subject: [PATCH] clear train --- cv4/a_train.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index cbd4b57..afaecb6 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -55,8 +55,11 @@ struct car* clear_train(struct car* first, const char* target) { if(strcmp(this->value, target) == 0){ this->next == this->next->next; free(this); + return first; + } + else { + continue; } - this = this->next; } return NULL; }