car
This commit is contained in:
parent
68a3b21ba9
commit
79d7a7636d
@ -40,15 +40,12 @@ void print_train(struct car* first) {
|
||||
}
|
||||
|
||||
void cancel_train(struct car* first) {
|
||||
if(!first){
|
||||
return NULL;
|
||||
if(first == NULL){
|
||||
return;
|
||||
}
|
||||
struct car* help = cancel_train(first->next);
|
||||
if(first->value != NULL){
|
||||
first->next = help;
|
||||
free(first);
|
||||
//cancel_train(help);
|
||||
//first->next = NULL;
|
||||
if(first->next != NULL){
|
||||
cancel_train(first->next);
|
||||
first->next = NULL;
|
||||
}
|
||||
//else if(first->next == NULL){
|
||||
//free(first);
|
||||
|
Loading…
Reference in New Issue
Block a user