pri nespravnom vstupe sa stopne nacitavanie
This commit is contained in:
parent
4433e5f29e
commit
d136e31b20
@ -20,7 +20,7 @@ int main() {
|
|||||||
if (buffer[0] == '\n') continue;
|
if (buffer[0] == '\n') continue;
|
||||||
int current_votes = 0;
|
int current_votes = 0;
|
||||||
char current_name[50] = "";
|
char current_name[50] = "";
|
||||||
sscanf(buffer, "%d %[^\n]", ¤t_votes, current_name);
|
if(sscanf(buffer, "%d %[^\n]", ¤t_votes, current_name) < 2 ) break;
|
||||||
int is_contained = 0;
|
int is_contained = 0;
|
||||||
for (int i=0; i<count; i++) {
|
for (int i=0; i<count; i++) {
|
||||||
if (strcmp(names[i], current_name) == 0) {
|
if (strcmp(names[i], current_name) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user