From 03a6547b8cea55c8917214a363cadda5b7cffd31 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 26 Mar 2016 12:20:28 +0100 Subject: Open files in binary mode Now that cmark supports different line endings, files must be openend in binary mode on Windows. Fixes issue #113. --- man/man3/cmark.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'man') diff --git a/man/man3/cmark.3 b/man/man3/cmark.3 index 523a3d4..283b9cc 100644 --- a/man/man3/cmark.3 +++ b/man/man3/cmark.3 @@ -543,7 +543,7 @@ Streaming interface: .nf \f[C] cmark_parser *parser = cmark_parser_new(CMARK_OPT_DEFAULT); -FILE *fp = fopen("myfile.md", "r"); +FILE *fp = fopen("myfile.md", "rb"); while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) { cmark_parser_feed(parser, buffer, bytes); if (bytes < sizeof(buffer)) { -- cgit v1.2.3