From 9aba27b55092f90220fcfaeee00e2492b1a024e1 Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Sun, 3 Sep 2017 10:44:57 -0400 Subject: [PATCH] UPDATED: Change fopen mode to fix issue on Windows --- Sources/multimarkdown/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/multimarkdown/main.c b/Sources/multimarkdown/main.c index 29af4a3..fe4a36a 100644 --- a/Sources/multimarkdown/main.c +++ b/Sources/multimarkdown/main.c @@ -477,7 +477,7 @@ int main(int argc, char** argv) { if (FORMAT_TEXTBUNDLE == format) { unzip_data_to_path(result->str, result->currentStringLength, output_filename); } else { - if (!(output_stream = fopen(output_filename, "w"))) { + if (!(output_stream = fopen(output_filename, "wb"))) { // Failed to open file perror(output_filename); } else { @@ -592,7 +592,7 @@ int main(int argc, char** argv) { if (strcmp(a_o->filename[0], "-") == 0) { // direct to stdout output_stream = stdout; - } else if (!(output_stream = fopen(a_o->filename[0], "w"))) { + } else if (!(output_stream = fopen(a_o->filename[0], "wb"))) { perror(a_o->filename[0]); free(result); d_string_free(buffer, true); -- 2.40.0