From 56ae5df2a6c6423311dfb9f73abb5516a150474b Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:29:11 +0100 Subject: [PATCH] clear train --- cv4/a_train.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 97ba3b7..d01dc7b 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -54,12 +54,12 @@ struct car* clear_train(struct car* first, const char* target) { while( this->next->next != NULL){ if(strcmp(this->next->value, target) == 0){ free(this->next); - this == this->next->next; + this->next = this->next->next; return first; } else { - continue; + this = this->next; } } - return NULL; + return first; }