diff --git a/cv10/program.c b/cv10/program.c index 0e3d339..19763c6 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -12,7 +12,7 @@ int main() { prihlasky = (char **)malloc(max * sizeof(char *)); if (scanf("%d", &max) != 1 || max <= 0) { puts("Nespravny vstup"); - return 1; + return 0; } fgets(name, 50, stdin); while (fgets(name, 50, stdin) && name[0] != '\n') { @@ -26,6 +26,10 @@ int main() { counter++; } } + if(counter == 0){ + puts("Ziadne prihlasky"); + return 0; + } qsort(prihlasky, counter, sizeof(char *), compare); puts("Prijati studenti:"); for (int i = 0; i < max && i < counter; i++) {