aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-04 14:06:48 -0500
committerDavid Robillard <d@drobilla.net>2018-01-04 19:34:53 -0500
commitb78b4387f2afe80ffc1e239cc75ca1774a51043d (patch)
tree1c0a192312eb52287de5edfa605308997e8a6679 /src
parent254db2b87025e06693e3f8b17e6c7a5363c2d416 (diff)
downloadserd-b78b4387f2afe80ffc1e239cc75ca1774a51043d.tar.gz
serd-b78b4387f2afe80ffc1e239cc75ca1774a51043d.tar.bz2
serd-b78b4387f2afe80ffc1e239cc75ca1774a51043d.zip
Open files in binary mode to preserve line endings on Windows
Diffstat (limited to 'src')
-rw-r--r--src/reader.c2
-rw-r--r--src/serdi.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c
index 36d01cae..d2e10f69 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1837,7 +1837,7 @@ serd_reader_read_file(SerdReader* reader,
return SERD_ERR_BAD_ARG;
}
- FILE* fd = serd_fopen((const char*)path, "r");
+ FILE* fd = serd_fopen((const char*)path, "rb");
if (!fd) {
free(path);
return SERD_ERR_UNKNOWN;
diff --git a/src/serdi.c b/src/serdi.c
index 9624e29c..16767ffd 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -204,7 +204,7 @@ main(int argc, char** argv)
in_name = in_name ? in_name : input;
if (!in_fd) {
input = serd_uri_to_path(in_name);
- if (!input || !(in_fd = serd_fopen((const char*)input, "r"))) {
+ if (!input || !(in_fd = serd_fopen((const char*)input, "rb"))) {
return 1;
}
}