projects
/
fw
/
stlink
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f300f74
)
Fix build warning
author
Michael Pratt
<michael@pratt.im>
Mon, 9 Jul 2012 15:08:55 +0000
(11:08 -0400)
committer
Michael Pratt
<michael@pratt.im>
Mon, 9 Jul 2012 15:08:55 +0000
(11:08 -0400)
src/stlink-common.c
patch
|
blob
|
history
diff --git
a/src/stlink-common.c
b/src/stlink-common.c
index a86d9854926ecf6928264187538f9ef7b08e618e..e142233f79095a493bc74b18eb1d78cd1e88158a 100644
(file)
--- a/
src/stlink-common.c
+++ b/
src/stlink-common.c
@@
-936,7
+936,9
@@
int stlink_fread(stlink_t* sl, const char* path, stm32_addr_t addr, size_t size)
}
/* Ignore NULL Bytes at end of file */
- ftruncate(fd, size - num_empty);
+ if (!ftruncate(fd, size - num_empty)) {
+ error = -1;
+ }
/* success */
error = 0;
@@
-1452,7
+1454,7
@@
int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, unsigned
for(off = 0; off < len;) {
size_t size = len - off > 0x8000 ? 0x8000 : len - off;
- printf("size: %u\n", size);
+ printf("size: %
z
u\n", size);
if (run_flash_loader(sl, &fl, addr + off, base + off, size) == -1) {
WLOG("run_flash_loader(%#zx) failed! == -1\n", addr + off);