summaryrefslogtreecommitdiff
path: root/archival/gunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r--archival/gunzip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 3a1d1cb..7be94e1 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -98,7 +98,8 @@ int gunzip_main(int argc, char **argv)
}
/* Open output file (with correct permissions) */
- dst_fd = xopen3(new_path, O_WRONLY | O_CREAT, stat_buf.st_mode);
+ dst_fd = xopen3(new_path, O_WRONLY | O_CREAT | O_TRUNC,
+ stat_buf.st_mode);
/* If unzip succeeds remove the old file */
delete_path = old_path;