From 12734e68e9c6ee01c340fa6d972103e05bd32866 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Tue, 28 Mar 2023 11:34:04 +0200
Subject: [PATCH] Fix a bug when writing a binary file in windows

---
 lib/cmp_io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cmp_io.c b/lib/cmp_io.c
index df96e70..f8a4883 100644
--- a/lib/cmp_io.c
+++ b/lib/cmp_io.c
@@ -145,7 +145,7 @@ static FILE *open_file(const char *dirname, const char *filename)
 		abort();
 	}
 
-	return fopen(pathname, "w");
+	return fopen(pathname, "wb");
 }
 
 
@@ -1208,7 +1208,7 @@ static __inline uint8_t str_to_uint8(const char *str, char const **str_end)
  * @returns the size in bytes to store the string content; negative on error
  */
 
-static ssize_t __inline str2uint8_arr(const char *str, uint8_t *data, uint32_t buf_size,
+static __inline ssize_t str2uint8_arr(const char *str, uint8_t *data, uint32_t buf_size,
 				      const char *file_name, int verbose_en)
 {
 	const char *nptr = str;
-- 
GitLab