diff --git a/cv5/a_train.c b/cv5/a_train.c index d98daa3..e865b4d 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -20,11 +20,10 @@ struct car* add_car(struct car* first,const char* target) { void print_train(struct car* first) { struct car* this = first; - /*if(first == NULL){ + if(first == NULL){ exit(0); - }*/ - //else{ - if(first != NULL){ + } + else{ while(this != NULL){ printf("%s\n", this->value); this = this->next; @@ -38,9 +37,9 @@ void cancel_train(struct car* first) { exit(0); } else if(first->next == NULL){ - this = first; - first = first->next; - free(this); + //this = first; + //first = first->next; + free(first); first = NULL; } else{