Fixing the logic problem

This commit is contained in:
Anton Dolozin 2025-10-28 20:51:28 +01:00
parent b0c719ef34
commit 83a5f4b60c

View File

@ -63,7 +63,7 @@ struct car* clear_train(struct car* first, const char* target) {
}
struct car* prev= NULL;
struct car* temp = first;
while (temp->next)
while (temp)
{
if(strcmp(temp->value, target) == 0){
struct car* targetNode = temp;