From 00692298069d44a0f90234dd437fb65650ade492 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 5 Nov 2020 15:29:00 +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 10baf4a..636a868 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -66,9 +66,9 @@ struct car* clear_train(struct car* first, const char* target) { while(prev->next->next != NULL){ int x = strcmp(first->value, target); if(x == 0){ - first = NULL; - first = prev->next; - free(prev); + //first = NULL; + first = first->next; + free(first); return first; }