]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: Change fopen mode to fix issue on Windows
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 3 Sep 2017 14:44:57 +0000 (10:44 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 3 Sep 2017 14:44:57 +0000 (10:44 -0400)
Sources/multimarkdown/main.c

index 29af4a3923f4698aefc408d9904858ec21b218a5..fe4a36a772e7339b0f969cdb158a8ffd03e858fb 100644 (file)
@@ -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);