From 358a91395d957ad626390fbbfcaec065cb49c532 Mon Sep 17 00:00:00 2001 From: Jiri Bilek Date: Fri, 21 Dec 2018 12:54:56 +0100 Subject: [PATCH] Add O_BINARY option to open file. (#753) See issue #752. --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index fa2a4607a..0a74bb2af 100644 --- a/src/common.c +++ b/src/common.c @@ -1364,7 +1364,7 @@ int stlink_fread(stlink_t* sl, const char* path, bool is_ihex, stm32_addr_t addr int error; - int fd = open(path, O_RDWR | O_TRUNC | O_CREAT, 00700); + int fd = open(path, O_RDWR | O_TRUNC | O_CREAT | O_BINARY, 00700); if (fd == -1) { fprintf(stderr, "open(%s) == -1\n", path); return -1;