From c6ade28c0baf4e5682ec10e6a4ca8f52a976dfed Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Wed, 4 Nov 2020 22:33:38 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 3f2062a..f618aa7 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -63,7 +63,7 @@ struct car* clear_train(struct car* first, const char* target) { } } struct car* this = first; - while(this->next->next != NULL){ + while(this->next != NULL){ int x = strcmp(this->value, target); if(x == 0){ struct car* curr = first; @@ -83,14 +83,14 @@ struct car* clear_train(struct car* first, const char* target) { } this = this->next; } - /* + int x = strcmp(this->next->value, target); if(x == 0){ free(this->next); this->next = NULL; return first; - }*/ + } return first; }