From eda46bc07f8bb557c4d208045a1eca73bc9d5f92 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Thu, 20 May 2010 07:11:33 +0200
Subject: [PATCH] tag_{id3,ape}: explicitly open files in binary mode

Add the flag "b" to fopen().  Windows compatibility.
---
 src/tag_ape.c | 2 +-
 src/tag_id3.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tag_ape.c b/src/tag_ape.c
index 4dfba2ca8..9a07c3ac9 100644
--- a/src/tag_ape.c
+++ b/src/tag_ape.c
@@ -78,7 +78,7 @@ tag_ape_load(const char *file)
 		unsigned char reserved[8];
 	} footer;
 
-	fp = fopen(file, "r");
+	fp = fopen(file, "rb");
 	if (!fp)
 		return NULL;
 
diff --git a/src/tag_id3.c b/src/tag_id3.c
index 008eff877..c1302ca86 100644
--- a/src/tag_id3.c
+++ b/src/tag_id3.c
@@ -495,7 +495,7 @@ struct tag *tag_id3_load(const char *file)
 	struct id3_tag *tag;
 	FILE *stream;
 
-	stream = fopen(file, "r");
+	stream = fopen(file, "rb");
 	if (!stream) {
 		g_debug("tag_id3_load: Failed to open file: '%s', %s",
 			file, strerror(errno));