From 01d6ac4513d0842e2b503e5784bbb67a95d15e15 Mon Sep 17 00:00:00 2001 From: kr820js Date: Sat, 20 Apr 2024 18:50:21 +0200 Subject: [PATCH] submition2 --- cv10/program.c | 3 +++ 1 file changed, 3 insertions(+) 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));