}
/* Ignore NULL Bytes at end of file */
- ftruncate(fd, size - num_empty);
+ if (!ftruncate(fd, size - num_empty)) {
+ error = -1;
+ }
/* success */
error = 0;
for(off = 0; off < len;) {
size_t size = len - off > 0x8000 ? 0x8000 : len - off;
- printf("size: %u\n", size);
+ printf("size: %zu\n", size);
if (run_flash_loader(sl, &fl, addr + off, base + off, size) == -1) {
WLOG("run_flash_loader(%#zx) failed! == -1\n", addr + off);
_stlink_sg_write_mem8,
_stlink_sg_read_all_regs,
_stlink_sg_read_reg,
+ NULL, /* read_all_unsupported_regs */
+ NULL, /* read_unsupported_regs */
+ NULL, /* write_unsupported_regs */
_stlink_sg_write_reg,
_stlink_sg_step,
_stlink_sg_current_mode,