From ec5cfb17742c5e766b73ec97acaa188cf3ba882c Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 15 Sep 2016 15:11:29 +0000 Subject: [PATCH] Port: open files in binary mode on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- include/babeltrace/compat/memstream-internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/babeltrace/compat/memstream-internal.h b/include/babeltrace/compat/memstream-internal.h index 8450f542..0b35330e 100644 --- a/include/babeltrace/compat/memstream-internal.h +++ b/include/babeltrace/compat/memstream-internal.h @@ -140,7 +140,7 @@ FILE *bt_fmemopen(void *buf, size_t size, const char *mode) /* * We need to write to the file. */ - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "wb+"); if (!fp) { goto error_unlink; } @@ -263,7 +263,7 @@ FILE *bt_open_memstream(char **ptr, size_t *sizeloc) g_free(tmpname); return NULL; } - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "wb+"); if (!fp) { goto error_unlink; } -- 2.34.1