add
This commit is contained in:
parent
9b936bc616
commit
3898228630
@ -43,15 +43,13 @@ void cancel_train(struct car* first) {
|
||||
if(first == NULL){
|
||||
exit(0);
|
||||
}
|
||||
if(first->next == NULL){
|
||||
struct car* this = first;
|
||||
first = first->next;
|
||||
free(this);
|
||||
first = NULL;
|
||||
else if(first->next == NULL){
|
||||
free(first);
|
||||
//first = NULL;
|
||||
}
|
||||
else{
|
||||
cancel_train(first->next);
|
||||
free(first);
|
||||
first->next = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user