diff --git a/cv4/a_train.c b/cv4/a_train.c index e4ca71c..fe22a14 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -4,12 +4,12 @@ #include "a_train.h" struct car* add_car(struct car* first, const char* target){ - if(!strcmp(target, "") && !first) + if(!strcmp(target, "")) return NULL; struct car* temp = first; - while(temp->next != NULL) + while(temp != NULL) temp = temp->next; temp->next = (struct car*)calloc(1, sizeof(struct car));