From: Fletcher T. Penney Date: Sun, 3 Sep 2017 14:44:57 +0000 (-0400) Subject: UPDATED: Change fopen mode to fix issue on Windows X-Git-Tag: 6.2.1^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aba27b55092f90220fcfaeee00e2492b1a024e1;p=multimarkdown UPDATED: Change fopen mode to fix issue on Windows --- 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);