diff --git a/cv10/program.c b/cv10/program.c index 4c9be8a..5b28683 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -27,11 +27,7 @@ int main() { } // Načítanie prihlášok - while (num_applications < max_students && fgets(buffer, sizeof(buffer), stdin) != NULL && buffer[0] != '\n') { - size_t len = strlen(buffer); - if (buffer[len - 1] == '\n') { - buffer[len - 1] = '\0'; // odstránenie koncového znaku nového riadku - } + while (num_applications < max_students && scanf("%s", buffer) == 1) { applications[num_applications] = strdup(buffer); if (applications[num_applications] == NULL) { puts("Chyba alokacie pamate");