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;
|
static int g_quit;
|
||||||
int force_color = 0;
|
int force_color = 0;
|
||||||
newfaction * new_players = 0;
|
newfaction * new_players = NULL;
|
||||||
|
|
||||||
state *current_state = NULL;
|
state *current_state = NULL;
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,9 @@ newfaction *read_newfactions(const char *filename)
|
||||||
|
|
||||||
if (fgets(buf, sizeof(buf), F) == NULL)
|
if (fgets(buf, sizeof(buf), F) == NULL)
|
||||||
break;
|
break;
|
||||||
|
if (buf[0] == '#') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
email[0] = '\0';
|
email[0] = '\0';
|
||||||
password[0] = '\0';
|
password[0] = '\0';
|
||||||
|
@ -95,9 +98,6 @@ newfaction *read_newfactions(const char *filename)
|
||||||
password, &alliance) < 3) {
|
password, &alliance) < 3) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (email[0] == '#') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (email[0] == '\0') {
|
if (email[0] == '\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue