mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
parse_leases: exit at read error
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
This commit is contained in:
parent
a31fd0d97a
commit
8d94580c3d
1 changed files with 3 additions and 1 deletions
|
|
@ -130,7 +130,9 @@ int parse_leases(void)
|
|||
}
|
||||
|
||||
while (!feof(dhcpd_leases)) {
|
||||
fgets(line, MAXLEN, dhcpd_leases);
|
||||
if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases)) {
|
||||
err(EXIT_FAILURE, "parse_leases: %s", config.dhcpdlease_file);
|
||||
}
|
||||
/* It's a lease, save IP */
|
||||
if (strstr(line, "lease") == line) {
|
||||
strncpy(ipstring, line, (size_t) MAXLEN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue