fixed a potential crash in sscanf when reading new factions.

This commit is contained in:
Enno Rehling 2006-12-01 00:34:10 +00:00
parent 433e89d1d6
commit 31a40b28f8
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ read_newfactions(const char * filename)
email[0] = '\0'; email[0] = '\0';
password[0] = '\0'; password[0] = '\0';
sscanf(buf, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance); if (sscanf(buf, "%54s %20s %8s %d %d %16s %d", email, race, lang, &bonus, &subscription, password, &alliance)<6) break;
if (email[0]=='\0') break; if (email[0]=='\0') break;
if (password[0]=='\0') { if (password[0]=='\0') {
strcpy(password, itoa36(rng_int())); strcpy(password, itoa36(rng_int()));