forked from github/server
idiot-proofing the newfactions file parser
This commit is contained in:
parent
bfd89687cd
commit
00ac549750
|
@ -47,7 +47,7 @@
|
|||
|
||||
static int g_quit;
|
||||
int force_color = 0;
|
||||
newfaction * new_players = 0;
|
||||
newfaction * new_players = NULL;
|
||||
|
||||
state *current_state = NULL;
|
||||
|
||||
|
|
|
@ -87,17 +87,17 @@ newfaction *read_newfactions(const char *filename)
|
|||
|
||||
if (fgets(buf, sizeof(buf), F) == NULL)
|
||||
break;
|
||||
if (buf[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
|
||||
email[0] = '\0';
|
||||
password[0] = '\0';
|
||||
|
||||
if (sscanf(buf, "%54s %19s %7s %15s %4d", email, race, lang,
|
||||
if (sscanf(buf, "%54s %19s %7s %15s %4d", email, race, lang,
|
||||
password, &alliance) < 3) {
|
||||
break;
|
||||
}
|
||||
if (email[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
if (email[0] == '\0') {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue