summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-09-04 21:43:35 +0000
committerJim Meyering <jim@meyering.net>2003-09-04 21:43:35 +0000
commit169a0a3f49a573e5d72c53f9e9910f29f263e47b (patch)
treea5b8f3e3700f383ce583b67e2d603e327f14774f /src
parent7750d1ac2de4cb0089e1529e654be2bfea4baa0b (diff)
downloadcoreutils-169a0a3f49a573e5d72c53f9e9910f29f263e47b.tar.xz
(elide_tail_lines_pipe): Don't truncate return value from safe_read.
Diffstat (limited to 'src')
-rw-r--r--src/head.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/head.c b/src/head.c
index 3d8103f85..aa58075ce 100644
--- a/src/head.c
+++ b/src/head.c
@@ -496,7 +496,8 @@ elide_tail_lines_pipe (const char *filename, int fd, uintmax_t n_elide)
n_elide newlines, or until EOF, whichever comes first. */
while (1)
{
- n_read = tmp->nbytes = safe_read (fd, tmp->buffer, BUFSIZ);
+ n_read = safe_read (fd, tmp->buffer, BUFSIZ);
+ tmp->nbytes = n_read;
if (n_read == 0 || n_read == SAFE_READ_ERROR)
break;
tmp->nlines = 0;