diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-25 11:20:35 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-25 11:20:35 +0000 |
commit | 379821d4ca338301b1ad7910948dbcdbd7713806 (patch) | |
tree | b7ae2fc8cb2f93190f107d0b30281f767b326c46 /usr.sbin/ppp | |
parent | 09944c345be5ccdda2b0574ccea1f177d2d91e49 (diff) |
handle empty strings returned by fgets
ok ray@
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ppp/radlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/radlib.c b/usr.sbin/ppp/ppp/radlib.c index 681d3fcf5d4..e7038ded2a7 100644 --- a/usr.sbin/ppp/ppp/radlib.c +++ b/usr.sbin/ppp/ppp/radlib.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: radlib.c,v 1.8 2003/04/04 20:25:06 deraadt Exp $ + * $OpenBSD: radlib.c,v 1.9 2007/09/25 11:20:34 chl Exp $ */ #include <sys/types.h> @@ -320,7 +320,8 @@ rad_config(struct rad_handle *h, const char *path) linenum++; len = strlen(buf); - /* We know len > 0, else fgets would have returned NULL. */ + if (len == 0) + continue; if (buf[len - 1] != '\n') { if (len == sizeof buf - 1) generr(h, "%s:%d: line too long", path, |