diff --git a/cv5/a_train.c b/cv5/a_train.c index 2e52925..c50cd62 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -69,7 +69,7 @@ struct car* clear_train(struct car* first, const char* target) { struct car* third = prev->next->next; free(prev->next); prev->next = third; - first->next = NULL; + prev->next->next = NULL; return first; } prev = prev->next;