From 6e0b65aaa8891ec1bd77070e38e48a702da84d8f Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 6 Nov 2022 10:37:09 +0100 Subject: [PATCH] Open the tar archive in binary mode, for systems that require it --- src/tar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tar.c b/src/tar.c index 14a519f..c0f5b0c 100644 --- a/src/tar.c +++ b/src/tar.c @@ -10,7 +10,7 @@ char* minitar_read_file(struct minitar_entry_metadata* metadata, struct minitar* struct minitar* minitar_open(const char* path) { - FILE* fp = fopen(path, "r"); + FILE* fp = fopen(path, "rb"); // On some systems, this might be necessary to read the file properly. if(!fp) return NULL; struct minitar* mp = malloc(sizeof(struct minitar)); if(!mp) { fclose(fp); return NULL; }