idiot-proofing the newfactions file parser

This commit is contained in:
Enno Rehling 2020-01-08 20:57:29 +01:00
parent bfd89687cd
commit 00ac549750
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;
} }