From e89e0eeda8b9e9701b2c33ad2a5bcd7c993f462a Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 15 Apr 1997 15:06:13 +0000 Subject: [PATCH] handle \\ at start of line; christos --- usr.sbin/netgroup_mkdb/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/netgroup_mkdb/util.c b/usr.sbin/netgroup_mkdb/util.c index 66909a3f2f8..b418409caf2 100644 --- a/usr.sbin/netgroup_mkdb/util.c +++ b/usr.sbin/netgroup_mkdb/util.c @@ -30,7 +30,7 @@ */ #ifndef lint -static char *rcsid = "$Id: util.c,v 1.1.1.1 1995/10/18 08:47:57 deraadt Exp $"; +static char *rcsid = "$Id: util.c,v 1.2 1997/04/15 15:06:13 deraadt Exp $"; #endif #include @@ -91,7 +91,7 @@ getline(fp, size) } if (ptr[s - 1] == '\n') /* the newline may be missing at EOF */ s--; /* forget newline */ - if ((cnt = (ptr[s - 1] == '\\'))) /* check for \\ */ + if (s && (cnt = (ptr[s - 1] == '\\'))) /* check for \\ */ s--; /* forget \\ */ buf = erealloc(buf, len + s + 1); -- 2.20.1