diff --git a/du4/a_train.c b/du4/a_train.c index 5bc9dcf..1bbb98c 100644 --- a/du4/a_train.c +++ b/du4/a_train.c @@ -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;