From 165dbb1a74116f1fe5c011c487af7529a0c24b8a Mon Sep 17 00:00:00 2001
From: dd
Date: Sat, 9 Mar 2002 03:52:14 +0000
Subject: When reporting that a line is too long, include the line number in
the error message. While I'm here, add a note that the "line too long"
message isn't always accurate.
PR: 35395
Submitted by: andrew@ugh.net.au
---
usr.sbin/pwd_mkdb/pwd_mkdb.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'usr.sbin/pwd_mkdb')
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 40dc511..bb913c4 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -505,7 +505,11 @@ scan(fp, pw)
* -- The Who
*/
if (!(p = strchr(line, '\n'))) {
- warnx("line too long");
+ /*
+ * XXX: This may also happen if the last line in a
+ * file does not have a trailing newline.
+ */
+ warnx("line #%d too long", lcnt);
goto fmt;
}
--
cgit v1.1