(wc): Fix off-by-one error when counting lines.

This commit is contained in:
Jim Meyering
1995-02-16 00:10:49 +00:00
parent e1453c467f
commit 695dd11003
+1 -1
View File
@@ -253,7 +253,7 @@ wc (fd, file)
--p;
do
{
p = memchr (p + 1, '\n', bytes_read);
p = memchr (p + 1, '\n', bytes_read + 1);
++lines;
}
while (p != buf + bytes_read);