This commit is contained in:
parent
cb21f01ac7
commit
fdde562ecf
@ -20,11 +20,10 @@ struct car* add_car(struct car* first,const char* target) {
|
||||
|
||||
void print_train(struct car* first) {
|
||||
struct car* this = first;
|
||||
/*if(first == NULL){
|
||||
if(first == NULL){
|
||||
exit(0);
|
||||
}*/
|
||||
//else{
|
||||
if(first != NULL){
|
||||
}
|
||||
else{
|
||||
while(this != NULL){
|
||||
printf("%s\n", this->value);
|
||||
this = this->next;
|
||||
@ -38,9 +37,9 @@ void cancel_train(struct car* first) {
|
||||
exit(0);
|
||||
}
|
||||
else if(first->next == NULL){
|
||||
this = first;
|
||||
first = first->next;
|
||||
free(this);
|
||||
//this = first;
|
||||
//first = first->next;
|
||||
free(first);
|
||||
first = NULL;
|
||||
}
|
||||
else{
|
||||
|
Loading…
Reference in New Issue
Block a user