Update 'cv10/program.c'

This commit is contained in:
Tamáš 2024-04-18 12:40:23 +00:00
parent 651bd07061
commit 0affccd25f

View File

@ -20,7 +20,7 @@ int main() {
if (scanf("%d\n", &maxStudents) != 1 || maxStudents <= 0) { if (scanf("%d\n", &maxStudents) != 1 || maxStudents <= 0) {
puts("Nespravny vstup"); puts("Nespravny vstup");
return 1; return 0;
} }
@ -34,7 +34,7 @@ int main() {
names = realloc(names, capacity * sizeof(char *)); names = realloc(names, capacity * sizeof(char *));
if (names == NULL) { if (names == NULL) {
perror("Failed to reallocate memory"); perror("Failed to reallocate memory");
return 1; return 0;
} }
} }
@ -51,7 +51,7 @@ int main() {
names[count] = strdup(name); names[count] = strdup(name);
if (names[count] == NULL) { if (names[count] == NULL) {
perror("Failed to duplicate name"); perror("Failed to duplicate name");
return 1; return 0;
} }
count++; count++;
} }
@ -59,7 +59,7 @@ int main() {
if (count == 0) { if (count == 0) {
puts("Ziadne prihlasky"); puts("Ziadne prihlasky");
return 1; return 0;
} }