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