Skip to content

Commit 9754930

Browse files
committed
Small update
1 parent b2c44ef commit 9754930

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

pyarchivefile/pyarchivefile.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4222,7 +4222,7 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, contentasfile=False, uncom
42224222
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
42234223
pass
42244224
fp.seek(len(delimiter), 1)
4225-
fjend = fp.tell() - 1
4225+
fjend = fp.tell() - len(delimiter)
42264226
jsonfcs = GetFileChecksum(fprejsoncontent, fjsonchecksumtype, True, formatspecs, saltkey)
42274227
if(not CheckChecksums(fjsonchecksum, jsonfcs) and not skipchecksum):
42284228
VerbosePrintOut("File JSON Data Checksum Error with file " +
@@ -4237,7 +4237,7 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, contentasfile=False, uncom
42374237
fname + " at offset " + str(fheaderstart))
42384238
VerbosePrintOut("'" + fcs + "' != " + "'" + newfcs + "'")
42394239
return False
4240-
fhend = fp.tell() - 1
4240+
fhend = fp.tell() - len(delimiter)
42414241
fcontentstart = fp.tell()
42424242
fcontents = MkTempFile()
42434243
pyhascontents = False
@@ -4437,7 +4437,7 @@ def ReadFileHeaderDataWithContentToArray(fp, listonly=False, contentasfile=True,
44374437
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
44384438
pass
44394439
fp.seek(len(delimiter), 1)
4440-
fjend = fp.tell() - 1
4440+
fjend = fp.tell() - len(delimiter)
44414441
jsonfcs = GetFileChecksum(fprejsoncontent, fjsonchecksumtype, True, formatspecs, saltkey)
44424442
if(not CheckChecksums(fjsonchecksum, jsonfcs) and not skipchecksum):
44434443
VerbosePrintOut("File JSON Data Checksum Error with file " +
@@ -4452,7 +4452,7 @@ def ReadFileHeaderDataWithContentToArray(fp, listonly=False, contentasfile=True,
44524452
fname + " at offset " + str(fheaderstart))
44534453
VerbosePrintOut("'" + fcs + "' != " + "'" + newfcs + "'")
44544454
return False
4455-
fhend = fp.tell() - 1
4455+
fhend = fp.tell() - len(delimiter)
44564456
fcontentstart = fp.tell()
44574457
fcontents = MkTempFile()
44584458
pyhascontents = False
@@ -4653,7 +4653,7 @@ def ReadFileHeaderDataWithContentToList(fp, listonly=False, contentasfile=False,
46534653
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
46544654
pass
46554655
fp.seek(len(delimiter), 1)
4656-
fjend = fp.tell() - 1
4656+
fjend = fp.tell() - len(delimiter)
46574657
jsonfcs = GetFileChecksum(fprejsoncontent, fjsonchecksumtype, True, formatspecs, saltkey)
46584658
if(not CheckChecksums(fjsonchecksum, jsonfcs) and not skipchecksum):
46594659
VerbosePrintOut("File JSON Data Checksum Error with file " +
@@ -4668,7 +4668,7 @@ def ReadFileHeaderDataWithContentToList(fp, listonly=False, contentasfile=False,
46684668
fname + " at offset " + str(fheaderstart))
46694669
VerbosePrintOut("'" + fcs + "' != " + "'" + newfcs + "'")
46704670
return False
4671-
fhend = fp.tell() - 1
4671+
fhend = fp.tell() - len(delimiter)
46724672
fcontentstart = fp.tell()
46734673
fcontents = MkTempFile()
46744674
pyhascontents = False
@@ -4810,7 +4810,7 @@ def ReadFileDataWithContentToArray(fp, filestart=0, seekstart=0, seekend=0, list
48104810
if(formdel != formatspecs['format_delimiter']):
48114811
return False
48124812
inheader = ReadFileHeaderDataBySize(fp, formatspecs['format_delimiter'])
4813-
headeroffsetend = fp.tell()
4813+
headeroffsetend = fp.tell() - len(delimiter)
48144814
fnumextrafieldsize = int(inheader[15], 16)
48154815
fnumextrafields = int(inheader[16], 16)
48164816
fextrafieldslist = []
@@ -4995,7 +4995,7 @@ def ReadFileDataWithContentToArray(fp, filestart=0, seekstart=0, seekend=0, list
49954995
return False
49964996
valid_archive = False
49974997
invalid_archive = True
4998-
prefhend = fp.tell() - 1
4998+
prefhend = fp.tell() - len(delimiter)
49994999
prefcontentstart = fp.tell()
50005000
prefcontents = MkTempFile()
50015001
pyhascontents = False
@@ -5246,7 +5246,7 @@ def ReadFileDataWithContentToList(fp, filestart=0, seekstart=0, seekend=0, listo
52465246
return False
52475247
valid_archive = False
52485248
invalid_archive = True
5249-
prefhend = fp.tell() - 1
5249+
prefhend = fp.tell() - len(delimiter)
52505250
prefcontentstart = fp.tell()
52515251
prefcontents = ""
52525252
pyhascontents = False

0 commit comments

Comments
 (0)