Fixing the link issue

This commit is contained in:
Anton Dolozin 2025-10-28 20:19:15 +01:00
parent 2110f6c8a6
commit 70c14170fa

View File

@ -65,9 +65,8 @@ struct car* clear_train(struct car* first, const char* target) {
struct car* next = first->next; struct car* next = first->next;
while (next->next) while (next->next)
{if(strcmp(next->value, target) == 0){ {if(strcmp(next->value, target) == 0){
temp->next = next->next;
next->next = NULL; next->next = NULL;
temp->next = next->next;
free(next); free(next);
} }