aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9bdfc58..19590ad 100644
--- a/main.c
+++ b/main.c
@@ -1081,7 +1081,7 @@ static int move_file(const char *const old, const char *const new)
{
int ret = -1;
const int fd_old = open(old, O_RDONLY),
- fd_new = open(new, O_WRONLY | O_CREAT, 0600);
+ fd_new = open(new, O_WRONLY | O_TRUNC | O_CREAT, 0600);
struct stat sb;
if (fd_old < 0)