From 6ebb141b1d027309b378c93681d6c347a98d48b2 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sun, 25 Dec 2016 01:54:39 +0100
Subject: Remember to truncate the output file
---
bfc-amd64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bfc-amd64.c b/bfc-amd64.c
index cf34b84..b2f0877 100644
--- a/bfc-amd64.c
+++ b/bfc-amd64.c
@@ -725,7 +725,7 @@ main (int argc, char *argv[])
FILE *output_file;
#ifdef __unix__
int output_fd;
- if ((output_fd = open (output_path, O_CREAT | O_WRONLY, 0777)) < 0)
+ if ((output_fd = open (output_path, O_CREAT|O_WRONLY|O_TRUNC, 0777)) < 0)
exit_fatal ("open: %s: %s\n", output_path, strerror (errno));
if (!(output_file = fdopen (output_fd, "w")))
exit_fatal ("fdopen: %s\n", strerror (errno));
--
cgit v1.2.3-70-g09d2