Skip to content

Commit

Permalink
u2c: fix chunksize calculation
Browse files Browse the repository at this point in the history
files which were exactly 128 GiB large would fail
(you can't make this shit up)
  • Loading branch information
9001 committed Oct 15, 2024
1 parent 65a2b6a commit a2e037d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/u2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def up2k_chunksize(filesize):
while True:
for mul in [1, 2]:
nchunks = math.ceil(filesize * 1.0 / chunksize)
if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks < 4096):
if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks <= 4096):
return chunksize

chunksize += stepsize
Expand Down

0 comments on commit a2e037d

Please sign in to comment.