Browse Source

Remember to truncate the output file

Přemysl Janouch 1 year ago
parent
commit
6ebb141b1d
Signed by: Přemysl Janouch <p.janouch@gmail.com> GPG Key ID: B715679E3A361BE6
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      bfc-amd64.c

+ 1
- 1
bfc-amd64.c View File

@@ -725,7 +725,7 @@ main (int argc, char *argv[])
725 725
 	FILE *output_file;
726 726
 #ifdef __unix__
727 727
 	int output_fd;
728
-	if ((output_fd = open (output_path, O_CREAT | O_WRONLY, 0777)) < 0)
728
+	if ((output_fd = open (output_path, O_CREAT|O_WRONLY|O_TRUNC, 0777)) < 0)
729 729
 		exit_fatal ("open: %s: %s\n", output_path, strerror (errno));
730 730
 	if (!(output_file = fdopen (output_fd, "w")))
731 731
 		exit_fatal ("fdopen: %s\n", strerror (errno));

Loading…
Cancel
Save