Update du4/program.c
This commit is contained in:
parent
36c2dd5a16
commit
4bbb299f45
@ -49,8 +49,7 @@ int main() {
|
|||||||
int has_data = 0;
|
int has_data = 0;
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), stdin)) {
|
while (fgets(line, sizeof(line), stdin)) {
|
||||||
if (sscanf(line, "%d %[^
|
if (sscanf(line, "%d %[^\n]", &votes, name) != 2 || votes < 0) {
|
||||||
]", &votes, name) != 2 || votes < 0) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Student *student = find_or_add(name);
|
Student *student = find_or_add(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user