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;
int force_color = 0;
newfaction * new_players = 0;
newfaction * new_players = NULL;
state *current_state = NULL;

View File

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