From c71c1f79130cfef2f6b4c1a3782cc30df408f862 Mon Sep 17 00:00:00 2001 From: Brett Gordon Date: Sun, 8 Apr 2018 12:42:12 -0400 Subject: [PATCH] tar: truncate existing files. --- Applications/util/tar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Applications/util/tar.c b/Applications/util/tar.c index 68151dc1..558d5f43 100644 --- a/Applications/util/tar.c +++ b/Applications/util/tar.c @@ -576,7 +576,7 @@ static void extract(char *argv[]) continue; } /* open output file */ - outfile = open(h.name, O_CREAT | O_WRONLY); + outfile = open(h.name, O_CREAT | O_WRONLY | O_TRUNC); if (outfile < 0) { pname(); break; -- 2.34.1