diff --git a/cv10/program.c b/cv10/program.c index 93afdab..2cd0f85 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -45,6 +45,9 @@ struct students* reading(){ struct students* current_student=first_student; struct students* last=NULL; while(fgets(buffer, sizeof(buffer), stdin )){ + if(strlen(buffer)==1){ + break; + } current_student->name=malloc(strlen(buffer) + 1); strcpy(current_student->name, buffer); current_student->next_student=malloc(sizeof(struct students));