car
This commit is contained in:
parent
79d7a7636d
commit
33dc166873
@ -8,7 +8,7 @@
|
|||||||
struct car* add_car(struct car* first,const char* target) {
|
struct car* add_car(struct car* first,const char* target) {
|
||||||
struct car* newcar = calloc(1, sizeof(struct car));
|
struct car* newcar = calloc(1, sizeof(struct car));
|
||||||
if(target == NULL){
|
if(target == NULL){
|
||||||
return;
|
exit(0);
|
||||||
}
|
}
|
||||||
strcpy(newcar->value, target);
|
strcpy(newcar->value, target);
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ void cancel_train(struct car* first) {
|
|||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
first->next = NULL;
|
first->next = NULL;
|
||||||
}
|
}
|
||||||
//else if(first->next == NULL){
|
if(first->next == NULL){
|
||||||
//free(first);
|
|
||||||
// cancel_train(first->next);
|
|
||||||
// }
|
|
||||||
free(first);
|
free(first);
|
||||||
|
// cancel_train(first->next);
|
||||||
|
}
|
||||||
|
//free(first);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user