Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbf62d93 authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

simg_dump.py: fix error for CHUNK_TYPE_FILL

In python3, division of two integers produces a float,
which cannot be used to multiply a bytes sequence.

Using // to produce an integer quotient.

Bug: 245257511
Test: ./system/core/libsparse/simg_dump.py -sv path/to/image
Change-Id: Ibe95056409ac3676a68f5e7693331ca4a66e9fb7
parent 9f7a19d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ def main():
          curtype = format("Fill with 0x%08X" % (fill))
          if showhash:
            h = hashlib.sha1()
            data = fill_bin * (blk_sz / 4);
            data = fill_bin * (blk_sz // 4);
            for block in range(chunk_sz):
              h.update(data)
            curhash = h.hexdigest()