summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-03 09:58:49 +0100
committerStef Walter <stefw@gnome.org>2013-03-03 10:07:14 +0100
commit61e0cb5dddb89ddab1d68791eb28d892c114622f (patch)
tree56d6c5d62ad4a9cd4f25693d9412283c5cb2b229 /p11-kit
parentd9076a99c59bb0132b25277a2340f428c9b6c98e (diff)
Open files in binary mode on windows
So that the Windows' C library doesn't munge line endings
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/conf.c2
-rw-r--r--p11-kit/pin.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/p11-kit/conf.c b/p11-kit/conf.c
index 28008aa..778ea00 100644
--- a/p11-kit/conf.c
+++ b/p11-kit/conf.c
@@ -125,7 +125,7 @@ read_config_file (const char* filename, int flags)
assert (filename);
- f = fopen (filename, "r");
+ f = fopen (filename, "rb");
if (f == NULL) {
error = errno;
if ((flags & CONF_IGNORE_MISSING) &&
diff --git a/p11-kit/pin.c b/p11-kit/pin.c
index afcb8ca..dac635c 100644
--- a/p11-kit/pin.c
+++ b/p11-kit/pin.c
@@ -465,7 +465,7 @@ p11_kit_pin_file_callback (const char *pin_source,
if (pin_flags & P11_KIT_PIN_FLAGS_RETRY)
return NULL;
- fd = open (pin_source, O_RDONLY);
+ fd = open (pin_source, O_BINARY | O_RDONLY);
if (fd == -1)
return NULL;