diff --git a/cv5/a_train.c b/cv5/a_train.c index cf81c20..7b0cdd1 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -63,6 +63,14 @@ struct car* clear_train(struct car* first, const char* target) { } } struct car* prev = first; + int z = strcmp(prev->value, target}; + if(z == 0){ + struct car* only = prev->next; + free(prev); + prev = only; + return first; + + } while(prev->next->next != NULL){ int x = strcmp(prev->next->value, target); if(x == 0){