ul_copy_file: use BUFSSIZ for buffer size

Suggested-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Egor Chelak <egor.chelak@gmail.com>
This commit is contained in:
Egor Chelak 2020-11-06 18:35:26 +02:00
parent 9203b41a4f
commit e453099640
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,7 @@ char *stripoff_last_component(char *path)
static int copy_file_simple(int from, int to)
{
ssize_t nr, nw, off;
char buf[8 * 1024];
char buf[BUFSIZ];
while ((nr = read(from, buf, sizeof(buf))) > 0)
for (off = 0; nr > 0; nr -= nw, off += nw)