Update du4/program.c

This commit is contained in:
Martin Kačmár 2025-03-19 18:33:55 +00:00
parent 36c2dd5a16
commit 4bbb299f45

View File

@ -49,8 +49,7 @@ int main() {
int has_data = 0;
while (fgets(line, sizeof(line), stdin)) {
if (sscanf(line, "%d %[^
]", &votes, name) != 2 || votes < 0) {
if (sscanf(line, "%d %[^\n]", &votes, name) != 2 || votes < 0) {
break;
}
Student *student = find_or_add(name);