fix a stack overflow in the flasher routine (my bad)

This commit is contained in:
bushing 2010-01-27 09:25:37 +00:00
parent 70b1a68543
commit cef938d883

View file

@ -52,9 +52,11 @@ void WriteBlock(unsigned int block_start, unsigned int len, unsigned char *buf)
if (block_start & 0xFF) {
printf("moving stuff forward by %d bytes\n", block_start & 0xFF);
memset(temp_buf, 0xFF, block_start & 0xFF);
memcpy(temp_buf + (block_start & 0xFF), buf, len);
memcpy(temp_buf + (block_start & 0xFF), buf, len - (block_start & 0xFF));
block_start &= ~0xFF;
} else memcpy(temp_buf, buf, len);
} else {
memcpy(temp_buf, buf, len);
}
UsbCommand c = {CMD_SETUP_WRITE};