diff --git a/src/metalink.c b/src/metalink.c
index 01e7bf4..76db2fa 100644
--- a/src/metalink.c
+++ b/src/metalink.c
@@ -433,7 +433,7 @@ verify_file_hash (const char *filename, mlink_checksum *checksums)
     }
   req_type = i;
 
-  if (!(file = fopen(filename, "r")))
+  if (!(file = fopen(filename, "rb")))
     {
       /* File could not be opened. */
       logprintf (LOG_VERBOSE, "Validating(%s) failed: file could not be opened.\n",
diff --git a/src/multi.c b/src/multi.c
index 0b4c3b4..4b22b2e 100644
--- a/src/multi.c
+++ b/src/multi.c
@@ -85,10 +85,10 @@ merge_temp_files(char *output)
   int j, ret;
   void *buf = malloc (MIN_CHUNK_SIZE);
 
-  out = fopen (output, "w");
+  out = fopen (output, "wb");
   for(j = 0; j < opt.jobs; ++j)
     {
-      in = fopen(files[j],"r");
+      in = fopen(files[j],"rb");
       ret = MIN_CHUNK_SIZE;
       while(ret == MIN_CHUNK_SIZE)
         {
