From da8f7b1a6aed42b7535db1eabe64c274bbb815a2 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 18 Dec 2011 19:13:46 +0100 Subject: [PATCH] If no read size is given, read the whole flash --- src/stlink-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stlink-common.c b/src/stlink-common.c index b49e21a..77ab98d 100644 --- a/src/stlink-common.c +++ b/src/stlink-common.c @@ -812,6 +812,9 @@ int stlink_fread(stlink_t* sl, const char* path, stm32_addr_t addr, size_t size) return -1; } + if (size <1) + size = sl->flash_size; + if (size > sl->flash_size) size = sl->flash_size; -- 2.30.2