diff -up dhcp-4.0.0/common/conflex.c.parse dhcp-4.0.0/common/conflex.c --- dhcp-4.0.0/common/conflex.c.parse 2008-01-17 09:05:17.000000000 -1000 +++ dhcp-4.0.0/common/conflex.c 2008-01-17 09:06:48.000000000 -1000 @@ -1434,16 +1438,18 @@ read_function (struct parse * cfile) { int c; - cfile -> buflen = read (cfile -> file, cfile -> inbuf, cfile -> bufsiz); - if (cfile -> buflen == 0) { + ssize_t n = read (cfile -> file, cfile -> inbuf, cfile -> bufsiz); + if (n == 0) { c = EOF; cfile -> bufix = 0; - } else if (cfile -> buflen < 0) { + cfile -> buflen = 0; + } else if (n < 0) { c = EOF; cfile -> bufix = cfile -> buflen = 0; } else { c = cfile -> inbuf [0]; cfile -> bufix = 1; + cfile -> buflen = n; } return c;