(match_user, main): Use full buffer for fgets(); was off by one.

This commit is contained in:
Markus Armbruster 2005-10-03 10:45:00 +00:00
parent 47d84b2479
commit 95d2b48ee2
2 changed files with 3 additions and 3 deletions

View file

@ -393,11 +393,11 @@ match_user(char *file, struct player *p)
}
match = 0;
while (!feof(fp) && !match) {
if (fgets(host, sizeof(host) - 1, fp) == NULL)
if (fgets(host, sizeof(host), fp) == NULL)
break;
if (host[0] == '#')
continue;
if (fgets(user, sizeof(user) - 1, fp) == NULL)
if (fgets(user, sizeof(user), fp) == NULL)
break;
host[strlen(host) - 1] = '\0';
user[strlen(user) - 1] = '\0';