Fix a logic mistake in comparison.
@@ -183,7 +183,7 @@ void lpc_write(struct lpc_device *dev, const struct sprog_data *d) {
j = max_chunk_index;
status = 1;
for(i=chunk_size; i>0; i-=chunk_sizes[j]) {
- for(j=j; j>0; j--)
+ for(j=j; j>=0; j--)
if(chunk_sizes[j]<=i)
break;
if(lpc_command(dev, "C %d %u %d\r\n", offset+(chunk_size-i), 0x10000400+(chunk_size-i), chunk_sizes[j]))