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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user