diff --git a/cv5/a_train.c b/cv5/a_train.c index 0116f41..7ad32a8 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -88,7 +88,7 @@ struct car* clear_train(struct car* first, const char* target) { if(first == this){ first = this->next; free(this); - first->next = NULL; + //first->next = NULL; return first; } while(curr != this){ @@ -97,6 +97,7 @@ struct car* clear_train(struct car* first, const char* target) { } prev->next = curr->next; + first->next = NULL: free(this); } this = this->next;