From 058b79b3c81cd319fa90f98c293cc72506bed448 Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:20:56 +0100 Subject: [PATCH] clear train --- cv4/a_train.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index afaecb6..38d914d 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -52,9 +52,9 @@ struct car* clear_train(struct car* first, const char* target) { } } while( this->next->next != NULL){ - if(strcmp(this->value, target) == 0){ + if(strcmp(this->next->value, target) == 0){ this->next == this->next->next; - free(this); + free(this->next); return first; } else {