]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(pipe_lines): Don't truncate return value from safe_read.
authorJim Meyering <jim@meyering.net>
Thu, 4 Sep 2003 21:43:12 +0000 (21:43 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 4 Sep 2003 21:43:12 +0000 (21:43 +0000)
src/tail.c

index f4299c9b8ff5d166916e8cf319a02db5d4de16c8..019130362ee159729f74c81b1e510352941ac081 100644 (file)
@@ -536,7 +536,8 @@ pipe_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
   /* Input is always read into a fresh buffer.  */
   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;
       *read_pos += n_read;