diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-12-25 01:54:39 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-12-25 01:56:42 +0100 |
commit | 6ebb141b1d027309b378c93681d6c347a98d48b2 (patch) | |
tree | 47410786c884259d160a5db60c4b023fa8c3d029 | |
parent | d52dcd1de717d6a38c004814c340c9e1187aa481 (diff) | |
download | bfc-6ebb141b1d027309b378c93681d6c347a98d48b2.tar.gz bfc-6ebb141b1d027309b378c93681d6c347a98d48b2.tar.xz bfc-6ebb141b1d027309b378c93681d6c347a98d48b2.zip |
Remember to truncate the output file
-rw-r--r-- | bfc-amd64.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |