From 6e78b51527a0150c3835426bc59ea2376ae56d10 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Sun, 25 Oct 2015 15:32:03 +1300 Subject: [PATCH] Missed a couple more binary file open()s --- telegram-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram-base.c b/telegram-base.c index 6e50ea1..5358df5 100644 --- a/telegram-base.c +++ b/telegram-base.c @@ -76,7 +76,7 @@ int read_pubkey_file (const char *name, struct rsa_pubkey *dst) { dst->n_len = 0; dst->n_raw = NULL; - int pubkey_fd = open (name, O_RDONLY); + int pubkey_fd = open (name, O_RDONLY | O_BINARY); if (pubkey_fd < 0) { return 0; } @@ -408,7 +408,7 @@ void read_secret_chat_file (struct tgl_state *TLS) { char *name = 0; name = g_strdup_printf("%s/%s", TLS->base_path, "secret"); - int secret_chat_fd = open (name, O_RDWR, 0600); + int secret_chat_fd = open (name, O_RDWR | O_BINARY, 0600); free (name); if (secret_chat_fd < 0) { return; }