From: Uwe Bonnes Date: Sun, 18 Dec 2011 18:13:46 +0000 (+0100) Subject: If no read size is given, read the whole flash X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=da8f7b1a6aed42b7535db1eabe64c274bbb815a2;p=fw%2Fstlink If no read size is given, read the whole flash --- 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;