diff --git a/era_apply.c b/era_apply.c index 0eb9399..551f913 100644 --- a/era_apply.c +++ b/era_apply.c @@ -50,7 +50,7 @@ void apply_blocks(int src, int dst, off64_t start, off64_t length) written = 0; while (written < fact) { - fact_write = write(dst, copy_buffer, fact-written); + fact_write = write(dst, copy_buffer+written, fact-written); if (fact_write <= 0) { fprintf(stderr, "Write error: %s\n", strerror(errno)); diff --git a/era_copy.c b/era_copy.c index 5ca625a..66d37ae 100644 --- a/era_copy.c +++ b/era_copy.c @@ -35,7 +35,6 @@ void copy_blocks(int src, int dst, off64_t start, off64_t length) fprintf(stderr, "Failed to copy data: %s\n", strerror(errno)); exit(1); } - cur += fact; copied += fact; } }