add
This commit is contained in:
parent
966e7ab243
commit
7d285ca052
@ -40,12 +40,12 @@ void print_train(struct car* first) {
|
|||||||
|
|
||||||
void cancel_train(struct car* first) {
|
void cancel_train(struct car* first) {
|
||||||
if(first == NULL){
|
if(first == NULL){
|
||||||
return;
|
exit(0);
|
||||||
}
|
}
|
||||||
if(first->next != NULL){
|
if(first->next != NULL){
|
||||||
first->next = NULL;
|
|
||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
free(first);
|
first->next = NULL;
|
||||||
|
//free(first);
|
||||||
}
|
}
|
||||||
if(first->next == NULL){
|
if(first->next == NULL){
|
||||||
free(first);
|
free(first);
|
||||||
|
Loading…
Reference in New Issue
Block a user