1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-04 07:43:58 +02:00

(start_lines): Handle the case in which bytes_read is zero.

This commit is contained in:
Jim Meyering
2002-02-01 09:12:50 +00:00
parent 06506ceb4f
commit 31cb36e88f
+3
View 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;