Изменил(а) на 'cv4/a_train.c'
This commit is contained in:
parent
e0089afd76
commit
ac53ed8b42
@ -43,10 +43,9 @@ void cancel_train(struct car* first){
|
||||
|
||||
while(next != NULL){
|
||||
next = temp->next;
|
||||
|
||||
free(temp);
|
||||
temp = next;
|
||||
}
|
||||
free(temp);
|
||||
|
||||
first = NULL;
|
||||
}
|
||||
@ -61,12 +60,11 @@ struct car* clear_train(struct car* first, const char* target){
|
||||
while(temp != NULL){
|
||||
next = temp->next;
|
||||
if(!strcmp(temp->value, target))
|
||||
|
||||
free(temp);
|
||||
temp = next;
|
||||
if(!first)
|
||||
first = temp;
|
||||
}
|
||||
free(temp);
|
||||
|
||||
return first;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user