Browse Source

Remember to truncate the output file

master
Přemysl Janouch 2 years 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[])
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));

Loading…
Cancel
Save