1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

(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

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);