aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tool_metalink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index 6e4a31c43..773158711 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -339,7 +339,8 @@ static int check_hash(const char *filename,
digest_context *dctx;
int check_ok;
int fd;
- fd = open(filename, O_RDONLY);
+ /* O_BINARY is required in order to avoid binary EOF in text mode */
+ fd = open(filename, O_RDONLY | O_BINARY);
if(fd == -1) {
fprintf(error, "Metalink: validating (%s) FAILED (%s)\n", filename,
strerror(errno));