]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(start_lines): Handle the case in which bytes_read is zero.
authorJim Meyering <jim@meyering.net>
Fri, 1 Feb 2002 09:12:50 +0000 (09:12 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 1 Feb 2002 09:12:50 +0000 (09:12 +0000)
src/tail.c

index 684cf1397ec67794a72cb46eb18a473f31e8f8b0..f94a075cfe8c32e9687572cf5384a3aac8552897 100644 (file)
@@ -756,6 +756,9 @@ start_lines (const char *pretty_filename, int fd, long int n_lines)
   int bytes_read = 0;
   int bytes_to_skip = 0;
 
+  if (n_lines == 0)
+    return 0;
+
   while (n_lines && (bytes_read = safe_read (fd, buffer, BUFSIZ)) > 0)
     {
       bytes_to_skip = 0;