From 26fb4270d0dd43f5809610d2641e4adf0c0703af Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Thu, 5 Nov 2020 19:35:57 +0100 Subject: [PATCH] 0.15 --- cv5/a_train.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 75396af..c313084 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -17,9 +17,9 @@ struct car* add_car(struct car* first,const char* target) { struct car* temp=first; int length=0; while(temp!=NULL){ - temp=temp->next; - length++; - printf("%d",length); + if(temp->next!=NULL) + temp=temp->next; + length++; } strcpy(newcar->value, target);