From 8ff67791a2bfefb59e540c78ffa455aa49bf017a Mon Sep 17 00:00:00 2001 From: Jaromil Date: Sun, 15 Dec 2024 20:33:41 +0100 Subject: [PATCH] fix: fopen for fwrite use binary mode this avoids adding a carriage return on windows --- src/muntar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/muntar.c b/src/muntar.c index 09f89bf..8b09b7f 100644 --- a/src/muntar.c +++ b/src/muntar.c @@ -219,7 +219,7 @@ int untar_to_path(const char *path, const uint8_t *buf, const size_t namelen = strlen(header->name); if(p-tpath+namelen>1023) return(MTAR_EOPENFAIL); strcpy(p,header->name); - FILE *fp = fopen(tpath,"w"); + FILE *fp = fopen(tpath,"wb"); if(!fp) { fprintf(stderr, "Error open file for write: %s\n",