diff --git a/src/platforms/pc/cl_utils.c b/src/platforms/pc/cl_utils.c index 114fd9e..57af8d3 100644 --- a/src/platforms/pc/cl_utils.c +++ b/src/platforms/pc/cl_utils.c @@ -306,7 +306,7 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) } } else if (opt->opt_mode == BMP_MODE_FLASH_READ) { /* Open as binary */ - read_file = open(opt->opt_flash_file, O_CREAT | O_RDWR | O_BINARY, + read_file = open(opt->opt_flash_file, O_TRUNC | O_CREAT | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR); if (read_file == -1) { printf("Error opening flashfile %s for read: %s\n",