diff --git a/lib/copy_file.c b/lib/copy_file.c index 55dee38..778cc00 100644 --- a/lib/copy_file.c +++ b/lib/copy_file.c @@ -29,7 +29,7 @@ goto out; } - dstfd = open(dst, O_WRONLY | O_CREAT); + dstfd = open(dst, O_WRONLY | O_CREAT | O_TRUNC); if (dstfd < 0) { printf("could not open %s: %s\n", dst, errno_str()); goto out;