Skip to content

Commit

Permalink
Fixed a few miscellaneous errors. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoliSoft authored and matteomattei committed Oct 10, 2016
1 parent 1f19c27 commit 7213a0a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PySquashfsImage/PySquashfsImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def lreg_header (self,buff,offset):
self.fragment,offset = self.autoMakeBufInteger(buff,offset,4)
self.offset,offset = self.autoMakeBufInteger(buff,offset,4)
self.xattr,offset = self.autoMakeBufInteger(buff,offset,4)
self.block_list[0],offset = self.autoMakeBufInteger(buff,offset,4)
self.block_list,offset = self.autoMakeBufInteger(buff,offset,4)
return offset

def dir_header (self,buff,offset):
Expand Down Expand Up @@ -490,9 +490,9 @@ def __init__(self):
self.size = 0

def fill(self,buffer,ofs):
self.xattr,ofs=autoMakeBufInteger(buffer,ofs,8)
self.count,ofs=autoMakeBufInteger(buffer,ofs,4)
self.size,ofs=autoMakeBufInteger(buffer,ofs,4)
self.xattr,ofs=self.autoMakeBufInteger(buffer,ofs,8)
self.count,ofs=self.autoMakeBufInteger(buffer,ofs,4)
self.size,ofs=self.autoMakeBufInteger(buffer,ofs,4)

class _Xattr_table(_Squashfs_commons):
def __init__(self):
Expand Down Expand Up @@ -607,7 +607,7 @@ def __init__(self,filepath=None,offset=None):
self.inode_table = str2byt("")
self.id_table = []
self.hash_table = {}
self.xattrs = ""
self.xattrs = b""
self.directory_table_hash={}
self.created_inode = []
self.total_blocks = 0
Expand Down Expand Up @@ -910,7 +910,7 @@ def read_xattrs_from_disk(self,myfile):
indexes = SQUASHFS_XATTR_BLOCKS(ids)
index = []
for r in range(0,ids):
index.append( self.makeInt(myfile,SQUASHFS_XATTR_BLOCK_BYTES(1)) )
index.append( self.makeInteger(myfile,SQUASHFS_XATTR_BLOCK_BYTES(1)) )
bytes = SQUASHFS_XATTR_BYTES(ids)
xattr_ids = {}
for i in range(0,indexes):
Expand All @@ -931,7 +931,7 @@ def read_xattrs_from_disk(self,myfile):
self.hash_table[start]= (i * SQUASHFS_METADATA_SIZE)
block,start,byte_count = self.read_block(myfile,start)
for i in range(len(block),SQUASHFS_METADATA_SIZE):
block+='\x00'
block+=b'\x00'
self.xattrs += block
i+=1
return ids
Expand Down

0 comments on commit 7213a0a

Please sign in to comment.