From 091df5dbdc6f002f215a1227ecd0f7361c28c547 Mon Sep 17 00:00:00 2001 From: Weber Date: Wed, 24 Apr 2024 10:15:19 +0000 Subject: [PATCH] test --- cv10/program.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cv10/program.c b/cv10/program.c index 79bed80..4b242e0 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -9,7 +9,7 @@ int main() { scanf("%d", &maxStudents); if (maxStudents <= 0) { - printf("Nespravny vstup\n"); + printf("Nespravny vstup"); return 1; } @@ -24,6 +24,11 @@ int main() { strcpy(names[numStudents], line); numStudents++; + if (numStudents >= MAX_STUDENTS) { + printf("Príliš veľa študentov. Zvážte navýšenie MAX_STUDENTS.\n"); + return 1; + } + } if (numStudents == 0) { printf("Ziadne prihlášky\n");