If no read size is given, read the whole flash
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Sun, 18 Dec 2011 18:13:46 +0000 (19:13 +0100)
committerUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Sun, 18 Dec 2011 18:13:46 +0000 (19:13 +0100)
src/stlink-common.c

index b49e21ab046afeb36e7b27ae605320381ef85215..77ab98d0275e0584c3bb1f9c499ef6cde0d2649d 100644 (file)
@@ -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;