Commit 774947138e9eb8e61534b54ad81f65de595b503d

James Humphrey 2020-01-08T07:12:47

Change fopen from "r" to "rb" Windows corrupts PDF files when not opening in binary mode (#5).

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/smtp.c b/src/smtp.c
index 223baa6..5734258 100644
--- a/src/smtp.c
+++ b/src/smtp.c
@@ -1448,7 +1448,7 @@ smtp_file_get_contents(const char *const filename,
   FILE *fp;
   char *read_buf;
 
-  if((fp = fopen(filename, "r")) == NULL){
+  if((fp = fopen(filename, "rb")) == NULL){
     return NULL;
   }