#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#ifdef __MINGW32__
connected_stlink = sl;
signal(SIGINT, &cleanup);
signal(SIGTERM, &cleanup);
+ signal(SIGSEGV, &cleanup);
if (state.reset) {
stlink_reset(sl);
DLOG("flash_do: page %08x\n", page);
unsigned send = length > FLASH_PAGE ? FLASH_PAGE : length;
if(stlink_write_flash(sl, page, fb->data + (page - fb->addr),
- send) < 0)
+ send, 0) < 0)
goto error;
length -= send;