From a56eaf102805824d6bc578d694344d3098d4733d Mon Sep 17 00:00:00 2001 From: Ivan Leichenko Date: Fri, 18 Oct 2024 00:10:53 +0200 Subject: [PATCH] pleh cv4 --- cv4/a_train.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cv4/a_train.c b/cv4/a_train.c index dd0f56f..0374dfb 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -104,6 +104,13 @@ struct car* clear_train(struct car* first, const char* target) while (prev->next->next != NULL) { if(!strcmp(prev->value, target)) + { + struct car* second = prev->next; + free(prev); + first = second; + return first; + } + else if(!strcmp(prev->next->value, target)) { struct car* third = prev->next->next; free(prev->next);