From 41d4e7acb001bbe1650fb6157ce8dffc4f2381cd Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:36:08 +0100 Subject: [PATCH] furt clear --- 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 be9d7ee..bcf8dd4 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -43,16 +43,16 @@ struct car* clear_train(struct car* first, const char* target) { if (this == NULL){ return NULL; } -/* if (this->next == NULL){ + if (this->next == NULL){ if(strcmp(this->value, target) == 0){ free(this); return NULL; }else { return first; } - }*/ + } while( this->next->next != NULL){ - if(strcmp(this->next->value, target) == 0){ + if(strcmp(this->value, target) == 0){ free(this->next); this->next = this->next->next; return first;