Merge pull request #322 from jrwhite/master
hexprog.hex fails due to divide-by-zero
This commit is contained in:
commit
0c659f49cd
|
@ -241,7 +241,7 @@ class Target:
|
||||||
block = 0
|
block = 0
|
||||||
for i in range(len(self.blocks)):
|
for i in range(len(self.blocks)):
|
||||||
block += 1
|
block += 1
|
||||||
if callable(progress_cb):
|
if callable(progress_cb) and totalblocks > 0:
|
||||||
progress_cb(block*100/totalblocks)
|
progress_cb(block*100/totalblocks)
|
||||||
|
|
||||||
# Erase the block
|
# Erase the block
|
||||||
|
|
Loading…
Reference in New Issue