This commit is contained in:
Radovan Kofira 2020-11-05 19:46:37 +01:00
parent 0bfd36a418
commit e70abbc8cd

View File

@ -17,10 +17,8 @@ struct car* add_car(struct car* first,const char* target) {
struct car* this=first; struct car* this=first;
int length=0; int length=0;
while(this!=NULL){ while(this!=NULL){
if(this->next!=NULL){
this=this->next; this=this->next;
this->next = newcar; this->next = newcar;
}
length++; length++;
} }
strcpy(newcar->value, target); strcpy(newcar->value, target);